Data Definition Language (DDL) Reference Manual
Named Constants
Data Definition Language (DDL) Reference Manual—529431-004
4-8
TAL
TAL
When generating pTAL or TAL source code from CONSTANT statements:
•
If you request pTAL or TAL source-code output by giving the TAL command, the
DDL compiler generates pTAL or TAL source code for named constants.
•
The DDL compiler converts any hyphen in the constant name to a circumflex (^) in
the TAL DEFINE name.
•
For a string constant, the DDL compiler generates a TAL DEFINE. Each DEFINE
specifies a value that exactly matches the constant value. TAL limits the length of a
string constant to 128 bytes, although the DDL compiler accepts string constants of
up to 130 ASCII characters.
•
For a numeric constant, the DDL compiler 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, the DDL compiler generates the pTAL or TAL
literal in octal representation.
•
For a product version constant, the DDL compiler generates a pTAL or TAL literal
that has a type equivalent to BINARY 16 UNSIGNED and that contains the product
version number.
Examples
In Example 4-2 on page 4-9, constant B inherits the type of constant A; that is,
constant B is also type BINARY 16 UNSIGNED.
Constant Type pTAL or TAL Data Type
BINARY 16 n
BINARY 32 n D
BINARY 64 n F
Example 4-1. CONSTANT Statements
CONSTANT prog-name VALUE IS "MYPROG".
CONSTANT myprog VALUE IS prog-name.
CONSTANT zspi-val-tandem-owner VALUE IS "TANDEM ".
CONSTANT hundred VALUE IS 100.
CONSTANT double-hundred VALUE 100 TYPE BINARY 32.
CONSTANT quad-num VALUE 800000 TYPE BINARY 64.
CONSTANT zspi-val-msghdrsize VALUE 6 TYPE BINARY 16
UNSIGNED.