5.7.3 Packed Decimal Variables
A packed decimal (DECIMAL data type) variable is made
up of several storage locations, the number of which de-
pends on the declared size of the variable. However, a packed
decimal variable is still referred to by a single variable name.
When you declare a packed decimal variable, you specify the
total number of digits and the number of digits to the right of
the decimal place that you want.
The following statement creates a packed decimal variable
named My_decimal , which can contain up to 8 digits: 6 digits
to the left of the decimal point and 2 digits to the right of the
decimal point.
OPTION TYPE = EXPLICIT
DECLARE DECIMAL (8,2) My_decimal
Packed decimal numbers are most useful for dollars-and-
cents calculations.