How to: |
The CHKPCK function validates the data in a field described as packed format (if available on your platform). The function prevents a data exception from occurring when a request reads a field that is expected to contain a valid packed number but does not.
To use CHKPCK:
CHKPCK(length, in_value, error, output)
where:
Numeric
Is the number of bytes in the packed field. It can be between 1 and 16 bytes.
Alphanumeric
Is the value to be verified as packed decimal. The value must be described as alphanumeric, not packed.
Numeric
Is the error code that the function returns if a value is not packed. Choose an error code outside the range of data. The error code is first truncated to an integer, then converted to packed format. However, it may appear on a report with a decimal point depending on the output format.
Packed-decimal
CHKPCK validates the values in PACK_SAL, and store the result in a column with the format P8CM. Values not in packed format return the error code -999. Values in packed format appear accurately.
CHKPCK(8, PACK_SAL, -999, 'P8CM')
iWay Software |