CEE3211S: Decimal divide exception (0CB) under Language Environment
CEE3211S means Language Environment caught a decimal-divide exception, system completion code 0CB. A packed decimal division had a divisor of zero, or the quotient was too big for the result field.
Other names for this code
Also written as CEE3211, CEE3211S 0CB, CEE3211S decimal divide, CEE3211S S0CB, LE 0CB, CEE34B.
What it means
COBOL and PL/I often do division on packed decimal (COMP-3) fields with the processor's decimal divide instruction. That instruction raises a decimal-divide exception if the divisor is zero, or if the quotient has more digits than the result field can hold. Under Language Environment (LE), the program check produces CEE3211S. The message says the system detected a decimal-divide exception and gives system completion code 0CB. The line under it names the compile unit, entry point and offset.
A zero divisor is by far the most common reason. The quotient-too-large case is rarer, because compilers normally size the work areas for it, but hand-written assembler and some odd field sizes can still hit it.
IBM notes that a condition handler can correct the data and let the program resume. Without one, LE ends the thread. The symbolic feedback code is CEE34B. Binary division by zero is a different message, CEE3209S.
Common causes
- A packed divisor was zero for the record being processed, for example a quantity, rate or count that the input left as zero.
- The divisor field was never initialized and happened to hold zero.
- A DIVIDE or COMPUTE has no ON SIZE ERROR phrase, so the division runs even when the divisor is zero.
- The quotient needs more digits than the result field allows, which mostly happens in assembler code or with unusually sized fields.
How to find the problem
- Match the offset on the line under CEE3211S to a statement in the compile listing.
- Display the divisor and dividend from the CEEDUMP, a debugger or a dump analysis tool. A divisor of zero settles it.
- Find which input record was being processed when the step failed, and look at the field the divisor came from.
- If the divisor isn't zero, compare the sizes of the dividend, divisor and result fields.
How to fix it
- Check the divisor before dividing and handle zero as the business rule requires.
- Add ON SIZE ERROR to COBOL DIVIDE and COMPUTE statements that can get a zero divisor.
- Initialize divisor fields and make sure every path sets them.
- Make the result field big enough for the largest possible quotient.
What it looks like
CEE3211S The system detected a decimal-divide exception (System Completion Code=0CB).
From compile unit RATECALC at entry point RATECALC at compile unit offset +000006F4
IEF450I PAYRUN01 STEP030 - ABEND=S0CB U0000 REASON=0000000BIBM documentation
IBM documentation: CEE3211S. Use the documentation for your installed release.
Related codes
Questions
Is CEE3211S the same as S0CB?
Yes. S0CB is the system completion code for a decimal-divide exception, and CEE3211S is the Language Environment message that reports it with the program and offset.
Why do I sometimes get CEE3209S for a divide by zero instead?
CEE3209S comes from binary division and CEE3211S from packed decimal division. Which one you get depends on how the fields are defined and how the compiler chose to do the arithmetic.
Can a decimal-divide exception happen without a zero divisor?
Yes, when the quotient is too large for the result field. That is uncommon in compiled COBOL but does occur.