Dictionary/3000 Reference Manual (32244-90001)

276 Chapter7
The Dictionary DICTCDE Utility
COBOL Data Type Mappings
COBOL Data Type Mappings
To be compatible with COBOL, the data types defined in the Dictionary must be mapped to
COBOL data types. The following shows how the Dictionary data types are mapped to
compatible COBOL data types. Note that the COBOL data types occupy the same storage
length as the data types defined in the Dictionary. However, some Dictionary definitions
allow numbers larger than what COBOL will allow (for example, the integer data type).
Also, for some data types, the Dictionary allows 28 and 29 numeric digit elements, whereas
COBOL only allows numeric elements to have a maximum of 18 digits. Elements defined
in the Dictionary that are larger than the maximum digits allowed by COBOL will be
flagged as an error and converted to data type X when generated by DICTCDE.
Any ASCII Character
Suppose the entity is defined in the Dictionary as:
ELEMENT-TYPE = X
ELEMENT-SIZE = 20
ELEMENT-LENGTH = 20
the corresponding COBOL clause will be generated:
PIC X(20)
Uppercase Alphanumeric String
Suppose the entity is defined in the Dictionary as:
ELEMENT-TYPE = U
ELEMENT-SIZE = 20
ELEMENT-LENGTH = 20
the corresponding COBOL clause will be generated:
PIC X(20)
Numeric ASCII String
Suppose the entity is defined in the Dictionary as:
ELEMENT-TYPE = 9 or 9+
ELEMENT-SIZE = 8
ELEMENT-DECIMAL = 2
ELEMENT-LENGTH = 7
the corresponding COBOL clause will be generated:
PIC 9(5)V9(2)