Data Definition Language (DDL) Reference Manual
Named Constants
Data Definition Language (DDL) Reference Manual—529431-004
4-9
Standard SPI Constants
If the second CONSTANT statement includes a TYPE clause, the clause overrides the
defining constant.
In Example 4-3 on page 4-9, the type specified for constant C overrides the type
specified for constant A.
When the data types are not the same, the constant value must be compatible with
each specified data type. In Example 4-4 on page 4-9, both statements are valid; the
value 1000 is compatible with both type BINARY 16 and type BINARY 32.
In Example 4-5 on page 4-9, the value of HI-VAL is too large for type BINARY 16. The
DDL compiler issues an error message and does not execute the CONSTANT
statement.
For examples using locale names, see Appendix B, Sample Schemas.
Standard SPI Constants
Subsystems that use DSM are provided with a set of CONSTANT statements to define
standard values for use in SPI messages. For the names and descriptions of standard
SPI constants, see the SPI Programming Manual and the SPI Common Extensions
Manual.
Example 4-2. Numeric Constant Defined by Existing Constant—Same Type
CONSTANT a VALUE 200 TYPE BINARY 16 UNSIGNED.
CONSTANT a VALUE b. ! Type binary 16 unsigned
Example 4-3. Numeric Constant Defined by Existing Constant—New Type
CONSTANT a VALUE 200 TYPE BINARY 16 UNSIGNED.
CONSTANT c VALUE a TYPE BINARY 16. ! Type binary 16
Example 4-4. Numeric Constants With Compatible Types
CONSTANT thousand VALUE 1000 TYPE BINARY 32.
CONSTANT max-value VALUE thousand TYPE BINARY 16.
Example 4-5. Numeric Constants With Incompatible Types
CONSTANT fifty-thou VALUE 50000 TYPE BINARY 16 UNSIGNED.
CONSTANT hi-val VALUE fifty-thou TYPE BINARY 16.
*** ERROR *** Invalid value for value type
*** WARNING *** Errors detected - no output produced for HI-VAL