Data Definition Language (DDL) Reference Manual
Data Definition Language (DDL) Reference Manual—529431-004
4-1
4 Named Constants
A named constant is a dictionary object that has a name, a data type, and a value. You
define named a constant in a CONSTANT statement, and you can refer to a named
constant value by name in other DDL statements.
Topics:
•
CONSTANT on page 4-1
•
Standard SPI Constants on page 4-9
CONSTANT
The CONSTANT statement defines a constant and adds it to the open dictionary.
When the constant is in the dictionary, other DDL statements can use the constant as
a literal value.
If a CONSTANT statement identifies a constant that is already in the dictionary and
that is not referenced by any other object, the DDL compiler replaces the existing
constant with the new constant. If the constant is referenced by another object, the
DDL compiler issues an error message and does not add the constant to the dictionary
If a previous command opened a C, COBOL, Pascal (on D-series systems), pTAL,
TACL, or TAL source code file, the DDL compiler translates any constant defined in a
CONSTANT statement to the specified language and writes it to the open source code
file.
constant-name
is the name of a constant.
num-value-clause
VALUE [ IS ] { { constant-number } [ LN-clause ]... }
{ { national-literal } }
{ { existing-constant } }
type
is the type of a numeric constant:
BINARY { [16] } [ UNSIGNED ]
{ 32 }
Default: BINARY 16
CONSTANT constant-name { num-value-clause [ TYPE type ] }
{ [ TYPE type ] num-value-clause }
{ value-clause }.