Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-35
Pascal (D-series Systems Only)
the name of the first structure being redefined. If the DDL-generated variant record
name is the same as any of its siblings defined in the same group, the DDL compiler
issues an error message and does not generate output.
Pascal does not do any run-time checking to enforce which variant is active at any
given time.
Example 6-26 on page 6-35 shows the Pascal source code generated by the DDL
compiler for a REDEFINES clause. The DDL compiler generates an anonymous record
(V_B) for the REDEFINES B clause because this clause was not the last level-02 item
in DEF A. The DDL compiler did not generate an anonymous record for the
REDEFINES D clause because it was the last level-04 item in D, nor did the DDL
compiler generate one for REDEFINES E because it was the last level-02 item in
DEF A.
Example 6-26. REDEFINES Clause With Pascal Output (page 1 of 2)
DDL Input
DEF A.
02 B PIC 9(4).
02 C REDEFINES B.
04 C-1 PIC 9(2).
04 C-2 PIC 9(2).
02 D.
04 D-1 PIC X.
04 D-2 PIC 9 REDEFINES D-1.
02 E PIC 9(5).
02 F REDEFINES E.
04 F-1 PIC 9(3).
04 F-2 PIC 9(2).
END.