Data Definition Language (DDL) Reference Manual
Definition Attributes
Data Definition Language (DDL) Reference Manual—529431-004
6-73
USAGE
When a group is declared as COMPUTATIONAL, each member of the group is also
COMPUTATIONAL. All elements of the group must either be declared TYPE BINARY
or have a picture compatible with TYPE BINARY. Reference definitions (TYPE * or
TYPE def-name ) are accepted if they refer to an element declared as
COMPUTATIONAL or TYPE BINARY.
For TAL and FORTRAN source code, the DDL compiler translates the
COMPUTATIONAL clause to the type and scale appropriate to the language. The data
type for translation is based on the number of 9s in the PICTURE:
See TYPE on page 6-49 for the TAL and FORTRAN data types that correspond to the
BINARY types.
For TACL source code, the DDL compiler translates COMP data types to binary data
types corresponding to the data types generated for TAL, unless scale is specified; the
DDL compiler ignores scale when generating TACL binary data types.
If the PICTURE of a COMPUTATIONAL item includes the symbol V, the DDL compiler
calculates the appropriate scale.
For COBOL source code, translation is not needed unless the usage is computational
by default; that is, the item is described as TYPE BINARY.
For C source code, the DDL compiler translates COMP data types to short, unsigned
short, long, unsigned long, or double C data types.
For Pascal source code (on D-series systems), the DDL compiler translates COMP
data types to INT16, CARDINAL, INT32, or INT64.
Appendix C, DDL Data Translation
, has tables showing the host-language data types
generated from the DDL COMP data types.
You can specify INDEX only for a field definition or a field description.
COBOL output for USAGE IS INDEX is the direct translation of the DDL source code,
without generation of the storage specification or of any COBOL attributes supported
by DDL for the field definition or description.
The DDL compiler verifies the size of the field against the target language before
generating the COBOL output for the field. To match the COBOL storage allocation for
index names, the field must be a 4-byte computational item.
You cannot specify INDEX for a noncomputational picture storage or character type.
A reference definition can refer to a field defined with INDEX, but the DDL compiler
does not generate COBOL output for the USAGE IS INDEX clause from the reference
definition.
Number of 9s Type
1 to 4 BINARY 16
5 to 9 BINARY 32
10 to 18 BINARY 64