Compiler Library/XL Reference Manual (32650-90029)
4- 11
---------------------------------------------------------------------------------------------
| | |
| Source Digit Count | Target "Words" |
| | |
---------------------------------------------------------------------------------------------
| | |
| 1 to 4 | 1 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 5 to 9 | 2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 10 to 18 | 4 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 19 to 28 | 6 |
| | |
---------------------------------------------------------------------------------------------
If the source digit count is zero, no conversion is performed.
Possible Traps
Invalid packed-decimal digit (3)
Invalid decimal operand length (5)
HPPACCVDB
HPPACCVDB converts a packed-decimal number to binary.
Declaration
PROCEDURE HPPACCVDB (
ANYVAR target :binary_type;
ANYVAR source :decimal_type;
sourcedigs :INTEGER;
VAR comparison_code :INTEGER;
VAR pacstatus :INTEGER)
OPTION
DEFAULT_PARMS (
comparison_code :=NIL,
pacstatus :=NIL)
UNCHECKABLE_ANYVAR;
EXTERNAL;
Comments
The number of decimal digits specified in the source digit count are
converted to a twos-complement binary number and stored in the target
field. The length of the target in sixteen-bit "words" is based on the
length of the source, as follows.