Each group and elementary item in a record requires a separate entry, and each must be assigned a level-number.
A level-number is a 1- or 2-digit integer between 01 and 49, or one of three special level-numbers: 66, 77, or 88. The following level-numbers are used to structure records:
All elementary or group items immediately subordinate to one group item must be assigned identical level-numbers higher than the level-number of this group item.
Figure 4 illustrates the concept. Note that all groups immediately subordinate to the level-01 entry have the same level-number. Note also that elementary items from different subgroups do not necessarily have the same level numbers, and that elementary items can be specified at any level within the hierarchy.
The COBOL record description entry written as follows is subdivided as indicated below:
01 RECORD_ENTRY. ______This entry includes_______ | 05 GROUP_1. ______This entry includes_____ | | | 10 SUBGROUP_1. ________This entry includes___ | | | | | 15 ELEM_1 PIC... . | | | 15 ELEM_2 PIC... . | | | | 10 SUBGROUP_2. ________This entry includes___ | | | | | 15 ELEM_3 PIC... . | | | 15 ELEM_4 PIC... . | | 05 GROUP_2. ________This entry includes___ | | | 15 SUBGROUP_3. _________This entry includes_____ | | | | | 25 ELEM_5 PIC... . | | | 25 ELEM_6 PIC... . | | | | 15 SUBGROUP_4 PIC... . This entry includes itself. | | 05 ELEM_7 PIC... . This entry includes itself.
The storage arrangement of the record description entry is illustrated below:
|______________________________RECORD_ENTRY______________________________ÿ| | | | | |___________GROUP_1______________ÿ|______________GROUP_2_______ÿ| | | | | | |__SUBGROUP_1__ÿ|__SUBGROUP_2___ÿ|____SUBGROUP_3_ÿ| | |
_______ ________ ________ ________ ________ ________ ____________ ________ |ELEM_1 | ELEM_2 | ELEM_3 | ELEM_4 | ELEM_5 | ELEM_6 | SUBGROUP_4 | ELEM_7 | |_______|________|________|________|________|________|____________|________|
Figure 4. Levels in a Record Description
01 EMPLOYEE-RECORD. 05 EMPLOYEE-NAME. 10 FIRST-NAME PICTURE X(10). 10 LAST-NAME PICTURE X(10). 05 EMPLOYEE-ADDRESS. 10 STREET PICTURE X(10). 10 CITY PICTURE X(10). X 01 EMPLOYEE-RECORD. X 05 EMPLOYEE-NAME. X 10 FIRST-NAME PICTURE X(10). X 10 LAST-NAME PICTURE X(10). X 04 EMPLOYEE-ADDRESS. X 08 STREET PICTURE X(10). X 08 CITY PICTURE X(10).
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.