CEE3209S: Fixed-point divide exception (0C9) under Language Environment
CEE3209S means Language Environment caught a fixed-point divide exception, system completion code 0C9. A binary (integer) division had a divisor of zero, or the result didn't fit in the target register.
Other names for this code
Also written as CEE3209, CEE3209S 0C9, CEE3209S fixed-point divide, CEE3209S S0C9, LE 0C9, CEE349.
What it means
Binary divide instructions work on integers held in registers. If the divisor is zero, or the quotient is too big for the result, the processor raises a fixed-point divide exception. Under Language Environment (LE), that program check produces CEE3209S. The message says the system detected a fixed-point divide exception and gives system completion code 0C9. As with the other CEE32xx messages, the next line gives the compile unit, entry point and offset.
IBM describes the cause as a signed binary division with a zero divisor. In COBOL this comes from a DIVIDE or COMPUTE on binary fields (COMP, COMP-4, COMP-5 or BINARY), or from a conversion of a packed number too large for a binary result. In C it is integer division by zero. The same mistake on packed decimal fields gives CEE3211S instead.
IBM notes that a condition handling routine can correct the data and let the application resume. With no handler, LE ends the thread. The symbolic feedback code is CEE349.
Common causes
- A divisor came from input or a calculation and was zero for this record, and the program didn't check it first.
- A count used as a divisor, such as a number of items or days, was never set because a branch that sets it didn't run.
- A DIVIDE or COMPUTE has no ON SIZE ERROR phrase, so nothing stops the zero divide from reaching the hardware.
- A packed decimal value too large for a 32-bit or 64-bit binary result was converted to binary. The processor reports that overflow as a fixed-point divide exception too.
- A storage overlay set the divisor field to zero.
How to find the problem
- Take the offset from the line under CEE3209S and find the statement in the compile listing.
- Look at the divisor in that statement. The CEEDUMP lists local variables for COBOL programs compiled with the right options, or you can use a debugger or Fault Analyzer.
- If the divisor isn't zero, check whether the statement converts a large packed value to binary.
- Find the input record being processed when the step failed, so you can see why the divisor was zero.
How to fix it
- Test the divisor before the division and handle zero in whatever way the business rule requires.
- Add ON SIZE ERROR to COBOL DIVIDE and COMPUTE statements that can see a zero divisor.
- Give count fields a starting value, and make sure every path through the program sets them.
- Widen binary fields that receive large converted values.
What it looks like
CEE3209S The system detected a fixed-point divide exception (System Completion Code=0C9).
From compile unit BILLCALC at entry point BILLCALC at compile unit offset +00000A10
IEF450I BILLRUN3 STEP020 - ABEND=S0C9 U0000 REASON=00000009IBM documentation
IBM documentation: CEE3209S. Use the documentation for your installed release.
Related codes
Questions
What is the difference between CEE3209S and CEE3211S?
CEE3209S is a divide exception in binary arithmetic (code 0C9). CEE3211S is a divide exception in packed decimal arithmetic (code 0CB). Both usually mean a zero divisor.
Does ON SIZE ERROR prevent CEE3209S?
For a COBOL DIVIDE or COMPUTE, yes. The compiled code checks for a zero divisor and runs the SIZE ERROR branch instead of letting the exception happen.
Is CEE3209S the same as S0C9?
Yes. S0C9 is the system completion code, and CEE3209S is how Language Environment reports it with the program and offset.