RENAMES clause
The RENAMES clause specifies alternative and possibly overlapping groupings of elementary data items.
The special level-number 66 must be specified for data description entries that contain the RENAMES clause. (Level-number 66 and data-name-1 are not part of the RENAMES clause, and are included in the format only for clarity.)
One or more RENAMES entries can be written for a logical record. All RENAMES entries associated with one logical record must immediately follow the last data description entry of that record.
- data-name-1
- Identifies an alternative grouping of data items.
A level-66 entry cannot rename a level-01, level-77, level-88, or another level-66 entry.
data-name-1 cannot be used as a qualifier; it can be qualified only by the names of level indicator entries or level-01 entries.
- data-name-2, data-name-3
- Identify the original grouping of elementary data items; that
is, they must name elementary or group items within the associated
level-01 entry and must not be the same data-name. Both data-names
can be qualified.
data-name-2 and data-name-3 can each reference any of the following items:
- An elementary data item
- An alphanumeric group item
- A national group item
When data-name-2 or data-name-3 references a national group item, the referenced item is processed as a group (not as an elementary data item of category national).
The OCCURS clause must not be specified in the data entries for data-name-2 and data-name-3, or for any group entry to which they are subordinate. In addition, the OCCURS DEPENDING clause must not be specified for any item defined between data-name-2 and data-name-3.
The TYPE clause must not be specified in the data descriptions of data-name-2, data-name-3, and items defined between data-name-2, data-name-3, or any subordinates of these items. If data-name-2, data-name-3, or any items defined between data-name-2 and data-name-3 are subordinate to a group item defined using the TYPE clause, then data-name-1 must be subordinate to the same group item.
The keywords THROUGH and THRU are equivalent.
When the THROUGH phrase is specified:
- data-name-1 defines
an alphanumeric
group item that includes all the elementary items that:
- Start with data-name-2 if it is an elementary item, or the first elementary item within data-name-2 if it is a group item
- End with data-name-3 if it is an elementary item, or the last elementary item within data-name-3 if it is an alphanumeric group item or national group item
- The storage area occupied by the starting item through the ending item becomes the storage area occupied by data-name-1.
Usage note: The group defined with the THROUGH phrase can include data items of usage NATIONAL.
The leftmost character position in data-name-3 must not precede the leftmost character position in data-name-2, and the rightmost character position in data-name-3 must not precede the rightmost character position in data-name-2. This means that data-name-3 cannot be totally subordinate to data-name-2.
When the THROUGH phrase is not specified:
- The storage area occupied by data-name-2 becomes the storage area occupied by data-name-1.
- All of the data attributes of data-name-2 become
the data attributes for data-name-1. That
is:
- When data-name-2 is an alphanumeric group item, data-name-1 is an alphanumeric group item.
- When data-name-2 is a national group item, data-name-1 is a national group item.
- When data-name-2 is an elementary item, data-name-1 is an elementary item.
The following figure illustrates valid and invalid RENAMES clause specifications.