z/OS message

CEE3207S: Data exception (0C7) under Language Environment

CEE3207S means Language Environment caught a data exception, system completion code 0C7. A decimal instruction found a packed or zoned decimal field that doesn't hold a valid number, most often spaces or low-values in a numeric field.

Other names for this code

Also written as CEE3207, CEE3207S 0C7, CEE3207S data exception, CEE3207S S0C7, LE 0C7, CEE347.

What it means

Decimal arithmetic on the mainframe works on packed decimal (COMP-3) and zoned decimal fields. The processor checks each digit and the sign before it uses one. If a byte holds something that isn't a digit, or the sign half-byte isn't a valid sign, it raises a data exception. When this happens in a program running under Language Environment (LE), LE writes CEE3207S. The text says the system detected a data exception and gives system completion code 0C7. The next line names the compile unit, entry point and offset.

IBM's guidance on this message is short. The decimal instruction was used wrongly, so check that the fields in the failing statement were set correctly. That matches what happens in practice. The code is rarely wrong. A field reaching it holds data that isn't a number.

LE ends the thread unless a condition handler deals with it. The symbolic feedback code is CEE347. The step usually ends with abend S0C7. Some runtime option settings end it with U4038 instead, but the cause is the same.

Common causes

  • An input record has spaces, letters or low-values in a field the program treats as a number, often from a file built by another system.
  • A numeric WORKING-STORAGE field was never given a starting value.
  • The copybook doesn't match the file layout, so the program reads the wrong bytes as a number.
  • A group MOVE copied text into a numeric field without converting it.
  • A subscript ran past a table and the program picked up bytes from a different field.
  • Two programs describe the same passed field differently, one as COMP-3 and one as DISPLAY.

How to find the problem

  1. Take the compile unit and offset from the CEE3207S line and find the statement in the compile listing (LIST or OFFSET option).
  2. List every numeric field that statement uses. One of them holds the bad value.
  3. Display those fields in hex from the CEEDUMP, a debugger or a tool such as Fault Analyzer. In a valid packed field every half-byte is 0 to 9 except the last, which is the sign.
  4. Find the record the program was working on when it failed, and look at the same field in the input data set.

How to fix it

  • Correct the bad data at its source and rerun the failed step.
  • Give numeric WORKING-STORAGE fields a starting value with VALUE ZERO or INITIALIZE.
  • Test input with IF field IS NUMERIC before using it, and reject or report records that fail.
  • Recompile every program that reads a file after its layout changes, so they all use the current copybook.

What it looks like

CEE3207S The system detected a data exception (System Completion Code=0C7).
         From compile unit PAYCALC at entry point PAYCALC at compile unit offset +000004A2
IEF450I PAYRUN01 STEP020 - ABEND=S0C7 U0000 REASON=00000007

IBM documentation

IBM documentation: CEE3207S. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Is CEE3207S different from S0C7?

No. S0C7 is the system completion code for the data exception, and CEE3207S is the Language Environment message that reports it with the program name and offset.

Why did the job only fail on one run?

The input changed. One record with a blank or non-numeric amount is enough to raise a data exception on a program that has run cleanly for years.

Can I stop a data exception without changing the data?

You can guard the code with an IS NUMERIC test so the program reports the record and carries on. Hiding bad data any other way usually moves the problem somewhere harder to find.