Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

5.3.13 RENAMES Clause



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.

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.


X Can specify a DBCS data item if data-name-2 specifies a DBCS data item
X and the THROUGH phrase is not specified.

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.

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:

  • 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 key words THROUGH and THRU are equivalent.

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:

  • 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 7 illustrates valid and invalid RENAMES clause specifications.



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



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.