RENAMES Clause

The RENAMES clause specifies alternative, possibly overlapping, groupings of elementary data items.

Read syntax diagramSkip visual syntax diagram
RENAMES Clause - Format

>>-66--data-name-1--RENAMES--data-name-2------------------------>

>--+--------------------------+--.-----------------------------><
   '-+-THROUGH-+--data-name-3-'      
     '-THRU----'                     

One or more RENAMES entries can be written for a logical record. All RENAMES entries associated with one logical record must immediately follow that record's last data description entry.
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.

IBM Extension

Data-name-1 can specify a DBCS data item if data-name-2 specifies a DBCS data item and the THROUGH phrase is not specified.

End of IBM Extension
IBM Extension

Data-name-1 can specify a national data item if data-name-2 specifies a national data item and the THROUGH phrase is not specified.

End of IBM Extension
IBM Extension
If data-name-2 references one of the following data items, and the THROUGH phrase is not specified, data-name-1 can be one of the following types of data items:
  • DBCS
  • National
  • Pointer or procedure-pointer
  • Internal or external floating-point
  • Date, time, or timestamp
End of IBM Extension
data-name-2, data-name-3
Identify the original grouping of elementary data items; that is, they must be elementary or group items within the associated level-01 entry, and must not be the same data-name. Both data-names may be qualified.

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 ON clause must not be specified for any item defined between data-name-2 and data-name-3.

IBM Extension

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 and 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.

End of IBM Extension
When data-name-3 is specified, data-name-1 is treated as a group item that includes all elementary items:
  • Starting 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)
  • Ending with data-name-3 (if it is an elementary item) or the last elementary item within data-name-3 (if it is a group item)

The leftmost character in data-name-3 must not precede that in data-name-2; the rightmost character in data-name-3 must follow that in data-name-2. This means that data-name-3 cannot be subordinate to data-name-2.

When data-name-3 is not specified, all of the data attributes of data-name-2 become the data attributes for data-name-1. That is:
  • When data-name-2 is a group item, data-name-1 is treated as a group item.
  • When data-name-2 is an elementary item, data-name-1 is treated as an elementary item.

Figure 1 illustrates valid and invalid RENAMES clause specifications.

Related Information: