Compiler Library/XL Reference Manual (32650-90029)
4-: 10
comparison_code :=NIL,
pacstatus :=NIL)
UNCHECKABLE_ANYVAR;
EXTERNAL;
Comments
* The source packed-decimal digits are converted to fill the
target field. An unsigned source operand produces an unsigned
external-decimal result. When the source is signed, the sign of the
result is determined by the two low-order bits of
sign_control
as
described below.
sign_control
= 0 Target sign is the same as source.
sign_control
= 1 Target is negative if source is negative.
Otherwise, it is unsigned.
sign_control
= 2 Target is unsigned.
sign_control
= 3 Target is unsigned.
*
Comparison_code
is set in accordance with the stored result. An
unsigned result is considered nonnegative, so only 0 or 2 can be
returned in
comparison_code
if
sign_control
is 2 or 3.
* If the target 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.