MainframeKit

S0CB

Decimal-divide exceptionSYSTEM ABEND

A packed-decimal divide failed, almost always because the divisor was zero.

MOST LIKELY

The divisor was zero for this record.

FIRST CHECK

Map the offset to the DIVIDE or COMPUTE in the listing.

TRY IT ▸

Record decoder

What it means

Code 0CB is the program check for a decimal divide exception. A decimal divide instruction could not give a result, either because the divisor was zero or because the quotient would not fit in the instruction's work area.

The numbers were valid (otherwise you would get 0C7 first); the division itself was impossible. Zero is a valid packed number, so the divisor passes an IS NUMERIC test.

Typical causes

  • The divisor was zero for this record.
  • A divisor field initialised to zero but never set, because of a missing READ or branch.
  • A wrong field layout, so the program used a different field as the divisor.
  • Rarely, a quotient too large for the intermediate work area.

How to fix it

  1. Map the offset to the DIVIDE or COMPUTE in the listing.
  2. Check the divisor's value for the failing record.
  3. Guard the divide with a zero test and handle the case the business way.
  4. Add ON SIZE ERROR to divisions that use external data.
  5. Include zero-divisor records in test data.

Example

Illustrative only; names and values are invented.

IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0CB  REASON CODE=0000000B
IEF450I RATEJOB1 STEP020 - ABEND=S0CB U0000 REASON=0000000B