The RENAMES clause specifies alternative, possibly overlapping, groupings of elementary data items.
___ Format _____________________________________________________________ | | | >>__66__data-name-1__RENAMES__data-name-2____________________________> | | | | >__ __________________________ _____________________________________>< | | |_ _THROUGH_ __data-name-3_| | | |_THRU____| | | | |________________________________________________________________________|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 itself, 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 that record's last data description entry.
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.
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.
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 the leftmost character in data-name-2; the rightmost character in data-name-3 must not precede the rightmost character in data-name-2. This means that data-name-3 cannot be totally 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:
COBOL Specifications Storage Layouts
Example 1 (Valid) 01 RECORD_I. 05 DN_1... . |<_______________RECORD_I_______________>| 05 DN_2... . ______ __________ ___________ __________ 05 DN_3... . | DN_1 | DN_2 | DN_3 | DN_4 | 05 DN_4... . |______|__________|___________|__________| 66 DN_6 RENAMES DN_1 THROUGH DN_3. |<___________DN_6____________>|
Example 2 (Valid) 01 RECORD_II. |<_______________RECORD_II______________>| 05 DN_1. |<___________DN_1_____________>| | 10 DN_2... . __________ ___________________ _________ 10 DN_2A... . | DN_2 | DN_2A | DN_5 | 05 DN_1A REDEFINES DN_1. |__________|___________________|_________| 10 DN_3A... . |<___________DN_1A____________>| 10 DN_3... . _______ ________ _____________ 10 DN_3B... . | DN_3A | DN_3 | DN_3B | 05 DN_5... . |_______|________|_____________| 66 DN_6 RENAMES DN_2 THROUGH DN_3. |<_____DN_6_____>|
Example 3 (Invalid) 01 RECORD_III. |<______________RECORD_III______________>| 05 DN_2. |<________DN_2_________>| | 10 DN_3... . __________ ____________ ________________ 10 DN_4... . | DN_3 | DN_4 | DN_5 | 05 DN_5... . |__________|____________|________________| 66 DN_6 RENAMES DN_2 THROUGH DN_3. DN_6 is indeterminate
Example 4 (Invalid) 01 RECORD_IV. |<______________RECORD_IV_______________>| 05 DN_1. |<_________DN_1___________>| | 10 DN_2A... . __________ _______________ _____________ 10 DN_2B... . | DN_2A | DN_2B | DN_3 | 10 DN_2C REDEFINES DN_2B. |__________|_______________|_____________| 15 DN_2... . _______ _______ 15 DN_2D... . | DN_2 | DN_2D | 05 DN_3... . |_______|_______| 66 DN_4 RENAMES DN_1 THROUGH DN_2. DN_4 is indeterminate
Figure 7. RENAMES Clause--Valid and Invalid Specifications
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.