REDEFINES enables you to code clauses in your data structures that redefine elements.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
Syntax:
dataname REDEF[INES]|R PICformat
Syntax Rules:
- When identifing controls in the Control Files clause,
dataname must be an elementary data name.
- In the following example, B cannot be used as a control variable because it is a group data item. To make B into an elementary data item, use the REDEFINES clause.
WS01 A PIC X(2).
WS01 B.
02 B-1 PIC 9(4).
02 B-2 PIC 9(4).
WS01 B-REDEF REDEFINES B PIC X(8).
.
.
.
RED TEST-REPORT
CONTROLS ARE A B-REDEF
Parameters:
PICformat
|
PICTURE format for data name being redefined
|
Example 1: Data Structure Editor format
-LINE- ------- Data Structure Editor --------
000001 WRK1-FIELD-8
000002 WRK1-FIELD-9 X4
000003 WRK1-FIELD-10 X(30)
000004 WRK1-FIELD-11 R X34
Example 2: Generated COBOL code
01 WRK1-FIELD-8.
05 WRK1-FIELD-9 PIC X(4).
05 WRK1-FIELD-10 PIC X(30).
01 WRK1-FIELD-11 REDEFINES WRK1-FIELD-8 PIC
X(34).