COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
• Restrictions on Level Numbers
The level number of a data description entry with a REDEFINES clause can be 01 in the
Working-Storage Section, Extended-Storage Section, or Linkage Section but not in the File
Section (where consecutive level-01 items are always multiple definitions of the same storage
space). When the level number is other than 01, the redefinition must specify a number of
character positions (bytes) that is less than or equal to the number of character positions in
the data item being redefined.
• Redefinitions Must All Specify Same Redefined Item
The REDEFINES clause redefines a storage area, not the data items occupying the area.
Multiple redefinition of the same record area is permitted, but each instance of data-name-2
must designate the name of the entry that originally defined the area.
• The EXTERNAL Clause and the REDEFINES Clause
The redefinition entry cannot contain the EXTERNAL clause.
When the redefined item is an external record item or is described with a level number other
than 01, the redefinition can specify the same or fewer character positions (bytes) than the
redefined item, but cannot specify more. When the redefined item is a record (that is, has a
level number of 01) without the EXTERNAL clause, there is no such constraint.
• Complete Description of Restrictions on Entry Order
The first redefinition of a data item must begin immediately after the last data description entry
associated with that item. Additional redefinitions can appear immediately after the first one
in any convenient order. Each redefinition begins with the data description entry that contains
the REDEFINES clause and continues with any other entries needed to define the subordinate
data items or condition-names that complete it. That is, the scope of the redefinition continues
until the appearance of a level number less than or equal to that of the data-name being
redefined, or to the end of the current section of the Data Division; therefore, the set of data
description entries that describe a data item and its redefinitions must appear in a continuous
sequence within either a single record description or, if the level number of the redefined item
is 01 or 77, a single section of the Data Division.
• Multiple Redefinitions
The REDEFINES clause associates the redefinition data item with the same storage area
occupied by the redefined data item. Because more than one redefinition can make reference
to the same redefined item, the same storage area can be described in as many ways as
required by the logic of the containing source program.
Although the REDEFINES clause associates multiple data description entries with one storage
area, the data items described by these entries are independent in all other respects; therefore,
the actual content of the shared storage area at any particular time does not necessarily
represent a valid value for all of the associated data items.
• Alignment and the REDEFINES Clause
The location of data items within a record can be affected by their storage alignment
requirements (see SYNCHRONIZED Clause).
When a redefinition item is an elementary item, its first character position must coincide with
the first character position of the redefined item. The compiler issues a diagnostic message if
the item’s alignment requirements make this impossible.
When a redefinition item is a data structure, the first character position of its initial contained
elementary item must coincide with the first character position of the redefined item. The
Descriptions of Records (Levels 01-49) 189










