77 level number in cobol

Level number 77 is used to define the independent working storage variables or in other terms level number 77 is used to define the individual elementary data items. The following are the rules of level number 77 data items.

Rules of level number 77


  • Level number 77 can only be used to define the individual elementary data items.
  • Level number 77 variables can’t sub divided themselves.
  • Level number 77 items must begin in area A
  • Level number 77 can't be used for redefines


Syntax:

77 variable-name PIC type(size)

Examples

77 EMPLOYEE-NAME PIC X(30).

77 EMPLOYEE-ID PIC 9(10).

In the above example individual elementary data item EMPLOYEE-NAME is defined with a size of 30 characters.

In the above example variable EMPLOYEE-NAME is not connected to any other variables. The following is an invalid example for level number 77.

Invalid Eaxmple:

01 EMPLOYEE-DETAILS.

77 EMPLOYEE-NAME PIC X(30).

As mentioned level number 77 data items should not be combined with any other data items. In the above example level 77 data item EMPLOYEE-NAME is defined under level 01 item EMPLOYEE-DETAILS which is not correct

Difference between level 01 and level 77

  • Level 77 can be used to describe independent working storage/linkage section variables.
  • Level 01 can be used to describe both elementary and group items. Any item described in Level 01, the system is putting on Double-Word boundary and inserts slack bytes if necessary.


More by this Author


Comments

No comments yet.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working