ILE COBOL Language Reference


RENAMES Clause

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

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.

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.

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:

+----------------------------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:

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:

Figure 9 illustrates valid and invalid RENAMES clause specifications.

Related Information:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]