Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 65
TYPE Clause
Bit Field Output for COBOL. The following examples show how DDL translates
definitions and descriptions of bit fields into COBOL85 source code:
DDL Type
COBOL85 Type
DEF Bit-1 TYPE BIT 1.
DEF New-Bit-1 TYPE Bit-1.
DEF Bit-10 TYPE BIT 10 UNSIGNED.
01 BIT-1 NATIVE-2.
01 NEW-BIT-1 NATIVE-2.
01 BIT-10 NATIVE-2.
DEF Bit-Map.
2 Bits-8 TYPE BIT 8.
2 Bits-3 TYPE BIT 3 UNSIGNED.
2 Bits-10 TYPE BIT 10.
End.
01 BIT-MAP.
02 FILLER NATIVE-2.
02 FILLER NATIVE-2.
DEF Bit-Struct.
2 Bits-0 TYPE Bit-1.
2 Bits-1-To-10 TYPE Bit-10.
End.
01 BIT-STRUCT.
02 FILLER NATIVE-2.
DEF Bit-Fillers.
2 Field-1 Type Character 3.
2 Filler Type Bit 4.
2 Bit-Field-1 Type Bit 5.
2 Filler Type Binary 16.
2 Field-2 Type Binary 32.
End.
01 BIT-FILLERS.
02 FIELD-1 PIC X(3).
* the following filler is implicit
02 FILLER PIC X(1).
* the following filler is bit maps
02 FILLER NATIVE-2.
* the following filler is explicit
02 FILLER NATIVE-2.
02 FIELD-2 NATIVE-4.
DEF Enum-Spec Begin
TYPE ENUM.
89 Val-1 Value 1.
89 Val-2 Value 3.
89 Val-3 Value 0.
End.
01 ENUM-SPEC NATIVE-2.
88 VAL-1 VALUE IS 1.
88 VAL-2 VALUE IS 3.
88 VAL-3 VALUE IS 0.
DEF Bits-With-Enums.
02 Bit-Field-1 TYPE BIT 8
ENUM Enum-Spec.
02 Bit-Field-2 TYPE BIT 4.
End.
01 BITS-WITH-ENUMS.
02 FILLER NATIVE-2.
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.
01 REUSED-BITS.
02 DATA-ITEM NATIVE-2.
02 BITS-LAYOUT-1
REDEFINES DATA-ITEM
03 FILLER NATIVE-2.
02 BITS-LAYOUT-2
REDEFINES DATA-ITEM
03 FILLER NATIVE-2.