The REDEFINES Clause
The REDEFINES clause allows the same computer storage area to be described
by different data description entries.
General Format

Note that level-number and data-name-1
or FILLER
are shown in the above format to improve clarity. Level-number, and data-name-1
and FILLER
are not part of the REDEFINES clause.
Syntax Rules
- The REDEFINES clause, when specified, must immediately follow data-name-1
or FILLER,
or it can follow the PICTURE or USAGE clause
.
- The level-numbers of data-name-1 and data-name-2 must be identical but must
not be 66,
78
or 88.
- This clause must not be used in level 01 entries in the File Section, since
multiple level 01 entries subordinate to an FD or SD indicator represent implicit
redefinitions of the same areas. (See General Rule 2 in the topic The DATA
RECORDS Clause.)
This clause can be used on level 01 entries in the File Section.

The data description for data-name-2 can contain a REDEFINES clause and
data-name-2 can be subordinate to an entry which contains a REDEFINES clause.
Its data description cannot contain an OCCURS clause. However, data-name-2
can be subordinate to an item whose data description entry contains an OCCURS
clause. In this case, the reference to data-name-2 in the REDEFINES clause
cannot be subscripted or indexed. Neither the original definition nor the
redefinition can include an item whose size is variable as defined in the
OCCURS clause. (See the topic The OCCURS Clause.)

The data description for data-name-2 can contain an OCCURS clause.
If the level number is 01, either or both of the original definition and
the redefinition can include an item whose size is variable as defined in
the OCCURS clause.
- No entry having a level-number numerically lower than the level-number of
data-name-2 and data-name-1 can occur between the data description entries
of data-name-2 and data-name-1.


An external or internal floating-point data item can be the subject or object
of a REDEFINES clause.
Data-name-2 must not be qualified even if it is not unique since no ambiguity
of reference exists in this case because of the required placement of the
REDEFINES clause .
Data-name-2 may be qualified but any qualification specified is ignored.
- The entries giving the new description of the character positions must not
contain any VALUE clauses except in condition-name entries.
The REDEFINES clause must not be specified for a data item of class object.
The REDEFINES clause may be specified for a data item of class object.
Data-name-2 must not be of class object.
Data-name-2 may be of class object.

Data-name-2 must not be described with the ANY LENGTH clause.
General Rules
- Redefinition starts at data-name-2 and ends when a level-number less than
or equal to that of data-name-2 is encountered.
- When the level-number of data-name-1 is other than 01, it must specify the
same number of character positions that the data item referenced by data-name-2
contains

except that the data-name-1 area can be either smaller than the data-name-2
area
or be larger than the data-name-2 area. In this case, extra storage is
reserved to provide sufficient storage for the number of character positions
in the largest of the redefining or redefined items.
It is important to observe that the REDEFINES clause specifies the redefinition
of a storage area, not of the data items occupying the area.
- Multiple redefinitions of the same character positions are permitted. The
entries giving the new descriptions of the character positions must follow
the entries defining the area being redefined, without intervening entries
that define new character positions. Multiple redefinitions of the same character
positions must all use the data-name of the entry that originally defined
the area


or the data-name of any other preceding redefinition of that entry
.
- Multiple level 01 entries subordinate to any given level indicator (FD
or SD) represent implicit redefinitions of the same area.