COBOL and type tree mapping
The COBOL Copybook Importer operation maps data names to type tree names.
The COBOL Copybook data names are converted to type tree names according to the following rules:
- Characters that are not valid in type tree element names are replaced with the underscore (_) character. For example, the invalid $ character in monthly$total is replaced with the underscore (_) character. Therefore, monthly$total becomes monthly_total.
- Duplicate names are made unique by appending one or more numeric digits to the names. For example, there are two instances of year. You can make one of the instances year1 and leave the other instance as year.
The COBOL Copybook Importer maps COBOL Copybook data types to type tree elements according to the following table. The importer operation maps FILLER items by appending a number incrementally to the end of the name. Examples are FILLER1, FILLER2, FILLER3, and so on. COBOL Copybook types that are not shown in the table are not supported by the importer.
The following table lists COBOL Copybook data types and the corresponding properties in the resulting type tree.
COBOL Copybook data type | Type tree properties |
---|---|
String,
length n
Examples of PICTURE clauses for alphanumeric data:
|
|
External
decimal, length n, virtual
places m
Example of a PICTURE clause for external decimal data:
|
|
Packed
decimal, length n, virtual
places m
Examples of the USAGE clause for packed-decimal data:
|
|
Integer,
length n
For the actual sizes of binary and floating point decimals, see the COBOL Language reference on the IBM website, http://www.ibm.com. Examples of the USAGE clause for binary integer data:
|
|
Float and double
Examples of the USAGE clause for internal floating-point data:
|
|
External
floating point, length n
Example of a PICTURE clause for external floating-point data:
|
|
Numeric-edited display, length n
Example of a PICTURE clause for numeric-edited data:
|
|
National-edited, length n
Example of a PICTURE clause for national-edited data in a date format:
|
|
Graphic,
length 2
n
Example of a PICTURE clause for graphic (G) data:
|
|
FUNCTION-POINTER, length n
Example of a FUNCTION-POINTER USAGE clause:
|
|