DB2 codes for numeric data in edit and validation routines
DB2® stores numeric data in a specially encoded "DB2-coded" format .

To retrieve numeric data in its original form, you must DB2-decode it according to its data type:
| Data type | DB2 decoding procedure |
|---|---|
| SMALLINT | Invert the sign bit (high-order bit).
|
| INTEGER | Invert the sign bit (high-order bit).
|
| FLOAT | If the sign bit (high-order bit) is 1, invert only that bit. Otherwise, invert
all bits.
|
| DECIMAL | Save the high-order hexadecimal digit (sign digit). Shift the number to the left
one hexadecimal digit. If the sign digit is X'F', put X'C' in the low-order
position. Otherwise, invert all bits in the number and put X'D' in the low-order position.
|
| BIGINT | Invert the sign bit (high order bit).
|
| DECFLOAT | Convert and return a DECFLOAT representation of a number or string representation
of a number.
|
