Named Constants
Data Definition Language (DDL) Reference Manual — 426798-002
4 -7
CONSTANT Statement
•
For a version constant, DDL generates a TACL TEXT variable that contains the
version number.
•
The internal representation of a DDL constant in TACL differs from the following
representations:
°
The internal representation of DDL constants in pTAL, TAL, and COBOL.
°
The internal representation of all other DDL objects in TACL. For a definition,
record, token code, token map, or token type, DDL generates a TACL
STRUCT with the same internal representation as pTAL or TAL source code.
This difference should cause no problems in messages because messages contain
data structures, not constants. If, however, you use #APPENDV to move a TACL
representation of a DDL constant to a message for a program coded in another
language, the value in the message will not match the same DDL constant in the
other language.
TAL Guidelines
The following points are guidelines for generating pTAL or TAL source code from
CONSTANT statements:
•
If you request pTAL or TAL source-code output by giving the TAL command, DDL
generates pTAL or TAL source code for named constants.
•
DDL converts any hyphen in the constant name to a circumflex (^) in the TAL
DEFINE name.
•
For a string constant, DDL generates a TAL DEFINE. Each DEFINE specifies a
value that exactly matches the constant value. Note that TAL limits the length of a
string constant to 128 bytes, although DDL accepts string constants up to 130
ASCII characters long.
•
For a numeric constant, DDL generates a pTAL or TAL literal based on the type of
the numeric constant. A numeric constant with a value n results in a different pTAL
or TAL literal for each DDL constant type:
If the type is specified as unsigned, DDL generates the pTAL or TAL literal in octal
representation.
•
For a version constant, DDL generates a pTAL or TAL literal that has a type
equivalent to BINARY 16 UNSIGNED and that contains the version number.
Constant Type
pTAL or TAL Data Type
BINARY 16
n
BINARY 32
n
D
BINARY 64
n
F