Decimal exception handling
z/OS® XL C decimal
instructions produce the following exceptions that are unique to decimal
operations:
- Data exception (interrupt code hex '7')
This may be caused by nonvalid sign or digit codes in a packed decimal number operated on by packed decimal instructions, for example,
ADD DECIMALorCOMPARE DECIMAL.When an operation is performed on decimal operands and the assignment is not through an explicit cast operation, the following situations cause runtime exceptions at execution time and SIGFPE is raised.
- Decimal-overflow exception (interrupt code hex 'A') This exception may be caused when nonzero digits are lost because the destination field in a decimal operation is too short to contain the result.Notes:
- Decimal overflow conditions are supported for System Programming Calls only with the runtime library.
- The following unhandled decimal overflow message is the same for
both decimal overflow and fixed overflow conditions:
However, because the fixed overflow condition is normally disabled (masked) and is ignored at run time, fixed overflow conditions should not occur.CEE3210S The system detected a Decimal-overflow exception.
- Decimal-divide exception (interrupt code hex 'B')
This exception may be caused when, in decimal division, the divisor is zero, or the quotient exceeds the specified data-field size. The decimal divide is indicated if the sign codes of both the divisor and dividend are valid, and if the digit or digits used in establishing the exception are valid.
Note: The following unhandled divide message does not distinguish between a decimal-divide condition and a fixed divide-by-zero condition:
Both are mapped into the same error message.CEE3211S The system detected a Decimal-divide exception.