In this example, there are three group level items, A, B, and E and there are four elementary items, C, D, F, and G. The sizes of the elementary items are determined by their picture clauses.
See picture clauses below for more information on this. The sizes of the group items are determined by the sizes of the elementary items below them. Since B consists of the elementary items C (20 characters) and D (10 characters), B is 30 characters in length. Since E consists of the elementary items F (5 characters) and G (10 characters), E is 15 characters in length. Since A consists of the sub-groups B (30 characters) and E (15 characters), A is 45 characters in length.Following is the last line of the 01 level item.
Level 77 : Stand Alone ItemsLevel 77 items have been designated for deletion from the COBOL language and have been included here only in case you encounter one in an existing program. Level 77 items should not be coded in new programs.
A level 77 item is used to define an item which is not to be subdivided any further. You can accomplish the same thing with a level 01 item, just don't subdivide it
To test for a company doing business in California, without the 88-level item, you would have to code:
It would not be apparent to the person reading the code what condition you were testing for. With the 88 in place, you could code the test like this:
Anybody reading the code could tell what condition you were testing for and if the check was done several times throughout the PROCEDURE DIVISION and the list of companies doing business in California changes, it is only necessary to change the list of values associated with the 88-level item.
While the data name associated with an 88-level item may have any value, the 88-level item itself can only have one of two values, true or false. The item is true if the data item immediately above the 88 has any of the values associated with the 88-item, otherwise it is false.
88- level items may be associated with either group or elementary items.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!