ISO/IEC 1989:2014 (E) (a.k.a. "COBOL 2014 standard") has this to say:
"A group includes all group and elementary items following it until a level-number less than or equal to the level-number of that group is encountered. All items that are immediately subordinate to a given group item shall be described using numerically equal level-numbers greater than the level-number used to describe that group item." I don't have the 1985 standard, so I can't speak to what it says. > Date: Tue, 29 Sep 2015 13:21:09 -0500 > From: [email protected] > Subject: Re: Error? COBOL level number "mistake" accepted by IBM compiler > To: [email protected] > > According to the IBM LRM, > > "A group item includes all group and elementary items that follow it until a > level-number less than or equal to the level-number of that group is > encountered." > > Why you want to do that escapes me at the moment, but the LRM goes on with an > example where the 05 and 04 variables are at the same level, as are the 10 > and 08: > > "You can also define groups with subordinate items that have different > level-numbers for the same level in the hierarchy. For example, 05 > EMPLOYEE-NAME > and 04 EMPLOYEE-ADDRESS in EMPLOYEE-RECORD below define the same level in the > hierarchy. The compiler renumbers the levels in a relative fashion, as shown > in the MAP output. > > 01 EMPLOYEE-RECORD. > 05 EMPLOYEE-NAME. > 10 FIRST-NAME PICTURE X(10). > 10 LAST-NAME PICTURE X(10). > 04 EMPLOYEE-ADDRESS. > 08 STREET PICTURE X(10). > 08 CITY PICTURE X(10)." > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
