How to: |
The PCKOUT function writes a packed-decimal number of variable length to an extract file. When a request saves a packed number to an extract file, it typically writes it as an 8- or 16-byte field regardless of its format specification. With PCKOUT, you can vary the field's length between 1 to 16 bytes.
PCKOUT(in_value, length, output)
where:
Numeric
Is the input value. It can be in packed, integer, single- or double-precision floating point format. If it is not in integer format, it is rounded to the nearest whole number.
Numeric
Is the length of the output value, from 1 to 16 bytes.
Alphanumeric
The function returns the field as alphanumeric although it contains packed data.
PCKOUT converts CURR_SAL to a five-byte packed format.
PCKOUT(CURR_SAL, 5, 'A5')
iWay Software |