Packed-decimal-integer encoding

The following values are valid for the packed-decimal-integer encoding:

    MQENC_DECIMAL_UNDEFINED
    Packed-decimal integers are represented using an encoding that is undefined.

    MQENC_DECIMAL_NORMAL
    Packed-decimal integers are represented in the conventional way:

    • Each decimal digit in the printable form of the number is represented in packed decimal by a single hexadecimal digit in the range X'0' through X'9'. Each hexadecimal digit occupies four bits, and so each byte in the packed decimal number represents two decimal digits in the printable form of the number.
    • The least significant byte in the packed-decimal number is the byte that contains the least significant decimal digit. Within that byte, the most significant four bits contain the least significant decimal digit, and the least significant four bits contain the sign. The sign is either X'C' (positive), X'D' (negative), or X'F' (unsigned).
    • The least significant byte in the number has the highest address of any of the bytes in the number; the most significant byte has the lowest address.
    • The least significant bit in each byte is adjacent to the byte with the next higher address; the most significant bit in each byte is adjacent to the byte with the next lower address.

    MQENC_DECIMAL_REVERSED
    Packed-decimal integers are represented in the same way as MQENC_DECIMAL_NORMAL, but with the bytes arranged in reverse order. The bits within each byte are arranged in the same way as MQENC_DECIMAL_NORMAL.

Parent topic: Machine encodings