How Packed Decimal Data Values Are Transformed
The left column contains the new data format that you want. The right column describes how the EXTRACT command reformats the packed decimal data value.
Table 1. How Packed Decimal Data Values Are Transformed
Data Format After TRANSFORM | How the Packed Decimal Data Value is Transformed |
---|---|
TRANSFORM(s:l C) | The packed decimal value is converted to a character string of length l. The packed decimal value is processed from right to left. Leading zeroes are replaced by blanks in the output. The most-significant digit of the character string will be preceded by a minus sign if the value is negative. Additional blanks will be supplied on the left if an excessive value is specified for l.The user is responsible for ensuring that l is large enough to hold the result. If l is greater than 256, the output will be truncated to 256 bytes. |
TRANSFORM(s:l X) | The absolute value of the packed decimal number is converted to a hexadecimal value of length l. The maximum value that can be converted is 4,294,967,295. If l is not large enough to contain the hexadecimal value, the least-significant bits of the hexadecimal value are output (that is, processing is from right to left). If l is larger than required to hold the hexadecimal value, the output will be filled with X'00' on the left. The user is responsible for ensuring that l is large enough to hold the result. l must be less than or equal to 256. Note that the sign of the packed decimal value is ignored, making this transformation the inverse of converting hexadecimal to packed decimal. |
TRANSFORM(s:l P) | l bytes are copied from right to left. The user is responsible for ensuring that l is large enough to hold the result. Additional packed decimal zeroes will be supplied on the left if an excessive value is specified for l. l must be less than or equal to 16. |
TRANSFORM(s:l Z) | The packed decimal value is converted to a zoned decimal value of length l. The value being converted must not contain more than 16 digits. The packed decimal value is processed from right to left. The zone digit of the right-most byte of the output value will reflect the sign. Additional zoned decimal zeroes will be supplied on the left if an excessive value is specified for l. The user is responsible for ensuring that l is large enough to hold the result. l must be less than or equal to 16. |
TRANSFORM(s:l F) | The packed decimal number is converted to a binary value of length l. The value to be converted must be in the range -2,147,483,648 to 2,147,483,647. If l is larger than required to hold the binary value, the sign bit of the binary value will be propagated to the left. The user is responsible for ensuring that l is large enough to hold the result. l must be less than or equal to 4. |
TRANSFORM(s:l U) | l bytes are copied from right to left; the sign of the packed value is not copied. The user is responsible for ensuring that l is large enough to hold the result. Additional packed decimal zeroes will be supplied on the left if an excessive value is specified for l. l must be less than or equal to 16. |