Additional numeric field considerations
This topic describes additional considerations for numeric fields.
Scale
With the exception of DECFLOAT fields, you can specify scale on any numeric (internal, EXTERNAL, or other format) fields with or without specifying a length. Specifying a scale multiplies or divides the number by a power of 10 or, for DECIMAL EXTERNAL, indicates where you want the decimal point. For example, INTEGER(,2) multiplies the number by 100, INTEGER(,-3) divides the number by 1000, and DECIMAL EXTERNAL(5,2) gives you two digits to the right of the decimal point, no matter what the scale of the source value is.
If you do not specify scale, 0 is the default unless the column is DECIMAL and the field is DECIMAL(PACKED) (explicit or defaulted), or DECIMAL ZONED. In these cases, the scale defaults to the scale of the column.
Restrictions
The following restrictions apply to the scale specification:
- You cannot specify scale on a DECFLOAT field.
- With the exception of a decimal field, UNLOAD PLUS does not support the scale specification on an output field if you are converting from a DECFLOAT column.
Rounding
For all numeric fields except DECFLOAT, you can specify ROUND to tell UNLOAD PLUS to round values during conversion to make them fit into the target field. Otherwise, UNLOAD PLUS truncates any additional digits that it does not need for precision. Truncation is not considered a conversion error.
For DECFLOAT columns, the value of the DECFLOAT_ROUNDMODE option determines the rounding method.
Related topic