Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-67
Specifying TYPE def-name
Specifying TYPE def-name
Specifying TYPE def-name refers to an existing definition that has a different name
from the object, group, or field that you are defining.
The DDL compiler reads def-name from the dictionary and then places the entire
definition at the level of the referring data element.
The level number of a data element immediately following the TYPE def-name data
element and in the same DEFINITION statement must be equal to or less than the
level number of the TYPE def-name data element.
If you use HEADING, DISPLAY, or VALUE in a definition that refers to another
definition, the new heading, display format, or initial value replaces the original
heading, display format, or initial valuebut only if the original value was at the
outermost level in the referenced definition.
Example 6-55. Bit Field Output for pTAL and TAL
DDL Type pTAL or TAL Type
DEF Enum-Spec Begin
TYPE ENUM.
89 Val-1 Value 1.
89 Val-2 Value 3.
89 Val-3 Value 0.
End.
LITERAL VAL^1 = 1,
VAL^2 = 3,
VAL^3 = 0;
INT ENUM^SPEC;
DEF Bits-With-Enums.
02 Bit-Field-1 TYPE BIT 8
ENUM Enum-Spec.
02 Bit-Field-2 TYPE BIT 4.
End.
STRUCT BITS^WITH^ENUMS^DEF (*) FIELDALIGN
(SHARED2);
BEGIN
UNSIGNED(8) BIT_FIELD_1;
UNSIGNED(4) BIT_FIELD_2;
BIT_FILLER 4;
END;
DEF Reused-Bits.
02 Data-Item Type Binary.
02 Bits-Layout-1
Redefines Data-Item.
03 F-11 TYPE BIT 5.
03 F-12 TYPE BIT 6.
03 F-13 TYPE BIT 4.
02 Bits-Layout-2
Redefines Data-Item.
03 F-21 TYPE BIT 4.
03 F-22 TYPE BIT 3.
End.
STRUCT REUSED^BITS^DEF (*) FIELDALIGN
(SHARED2);
BEGIN
INT DATA^ITEM;
STRUCT BITS^LAYOUT^1 = DATA^ITEM;
BEGIN
UNSIGNED(5) F^11;
UNSIGNED(6) F^12;
UNSIGNED(4) F^13;
BIT_FILLER 1;
STRUCT BITS^LAYOUT^2 = DATA^ITEM;
BEGIN
UNSIGNED(4) F^21;
UNSIGNED(3) F^22;
BIT_FILLER 9;
END;
END;