IBM Extension
IBM Extension
Coding Example
The ILE COBOL compiler accepts nonstandard level-numbers that are not identical
to others at the same level. For example, the following two data description
entries are equivalent:
01 EMPLOYEE-RECORD.
05 EMPLOYEE-NAME.
10 FIRST PICTURE X(10).
10 LAST PICTURE X(10).
05 EMPLOYEE-ADDRESS.
10 STREET PICTURE X(10).
10 CITY PICTURE X(10).
01 EMPLOYEE-RECORD.
05 EMPLOYEE-NAME.
10 FIRST PICTURE X(10).
10 LAST PICTURE X(10).
04 EMPLOYEE-ADDRESS.
08 STREET PICTURE X(10).
08 CITY PICTURE X(10).
Because 04 is less than 05, it is not subordinate to EMPLOYEE-NAME, yet because it is greater than 01 it is subordinate to EMPLOYEE-RECORD. If 07 was used in place of 04, EMPLOYEE-ADDRESS would be subordinate to EMPLOYEE-NAME (which in this example would be undesirable).
Such coding practices are not recommended, and this extension is provided only for compatibility.
End of IBM Extension