COBOL Manual for TNS/E Programs (H06.03+)

Data Division
HP COBOL Manual for TNS/E Programs520347-003
7-49
REDEFINES Clause
Series of Redefinitions
You can describe a series of redefinition entries with the same level number as that
of the redefined entry, provided that each of these entries also contains a
REDEFINES clause specifying the data-name of the redefined item.
You cannot, however, separate a redefinition entry from the redefined entry by any
data description entry with a numerically lower level number.
No Redefinitions of Level-66 or Level-88 Items
Data items of level 66 (RENAMES) and 88 (condition-name) cannot be redefined.
Redefined Item Cannot Include OCCURS or REDEFINES
The description of data-name-2 cannot include an OCCURS clause or
REDEFINES clause; however data-name-2 can be subordinate to an item
containing one or both clauses, and items subordinate to data-name-2 can
contain one or both clauses. Because an OCCURS clause can occur in the
description of data-name-1, it is common to declare a record first and then to
declare an array that redefines the same storage.
Neither the original definition nor the redefinition can include an item whose size is
variable due to an OCCURS clause of a subordinate entry.
No Subscripting or Qualifying in REDEFINES
The REDEFINES declaration cannot include any subscripting or qualification on
data-name-2. Qualification is automatic.
VALUE Clauses Only in Condition-Name Descriptions
VALUE clauses are not permitted in the redefinition except as part of a condition-
name declared in conjunction with a conditional variable in the redefinition.
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.