Data Definition Language (DDL) Reference Manual

Named Constants
Data Definition Language (DDL) Reference Manual529431-004
4-3
Numeric Constants
Topics:
Numeric Constants on page 4-3
Product Version Constants on page 4-4
Existing Constants on page 4-5
C on page 4-5
COBOL on page 4-6
Pascal (D-series Systems Only) on page 4-6
TACL on page 4-7
TAL on page 4-8
Examples on page 4-8
Numeric Constants
Each type of numeric constant has a different range of valid values, as Table 4-1 on
page 4-3 shows.
The type of a numeric constant:
Ensures that the specified value is consistent with the type, whether the type is
explicitly specified or is BINARY 16 by default. For example, the value 40,000 is
not consistent with type BINARY 16 because the value is too large, but it is
consistent with type BINARY 16 UNSIGNED. If a value is not consistent with its
type, the CONSTANT statement fails.
Controls the types of COBOL, pTAL, and TAL data items generated for the
constant. For example, type BINARY 32 causes the DDL compiler to generate a
pTAL or TAL LITERAL with a double-word value and a COBOL NATIVE-4 two-
word value. The DDL compiler translates binary numbers as TACL TEXT values
rather than as binary data in a STRUCT so, the TYPE clause does not affect TACL
output from DDL constants.
Table 4-1. Ranges of Numeric Constant Values
Type Lowest Value Highest Value
BINARY 16 -32,768 32,767
BINARY 16 UNSIGNED 0 65,535
BINARY 32 -2,147,483,648 2,147,483,647
BINARY 32 UNSIGNED 0 4,294,967,295
BINARY 64 -9,223,372,036,854,775,808 9,223,372,036,854,775,807