Db2 decoding 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 | Decoding examples |
|---|---|---|
| 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 | See the information on sortable decimal formats in Db2 12 for z/OS licensed diagnosis information. |
|