Packed-decimal fields have the formats
|ds|
|dd|ds|
|dd|dd|ds
|dd|dd|dd|ds|
. . .
Each byte, that is, contains either two four-bit digits or, iff it is the rightmost one, a single four-bit digit followed by a four-bit sign representation. The licit representations of decimal digits are the obvious ones,
0000 for 0, 0101 for 5
0001 for 1, 0110 for 6
0010 for 2, 0111 for 7,
0011 for 3, 1000 for 8
0100 for 4 1001 for 9
The licit representations of signs are the remaining 6 four-bit values, viz.,
1010
1011
1100
1101
1110
1111.
The message you are getting (a) confirms the fact that an attempt to convert a packed-decimal value into a numeric character value is being attempted and (b) tells you that the sign representation, s in the two-byte input |dd|ds|, has the binary value 0000, which is not a licit packed-decimal sign representation: it represents the decimal digit 0 instead.
Your error thus appears to be a data error.
John Gilmore
SystemCraft LLC
The opinions expressed above are mine alone. In particular, they are not necessarily shared by my company or its clients.
