S0C7
The program did a sum on a field that does not hold a number.
Also written 0C7, ABEND S0C7, DATA EXCEPTION, CEE3207S
Why it matters. It's the most common abend in banking batch. Knowing how to read it saves the night run.
Syntax
IEF450I jobname stepname - ABEND=S0C7 U0000 REASON=00000007 CEE3207S The system detected a data exception (System Completion Code=0C7).
- Spaces in a numeric field
- Fix the file that sends them, or initialise the field.
- Low-values (X'00')
- Initialise the field before the program uses it.
- Bad sign or digit in a packed field
- Fix the data, or check IF NUMERIC before the sum.
- Field not set up
- A working-storage field with no VALUE and no MOVE. Give it a start value.
- Wrong record layout
- The copybook does not match the file. Fix the layout.
- Table index past the end
- Reads bytes that are not your table. Check the subscript.
Try it S0C7
- 1
Job RUNTOT runs the program ACCTTOT, which adds up payment amounts. Send it from your DEV JCL library to run.
SUBMIT 'ZB0001.DEV.JCL(RUNTOT)' - 2
Read the output of the job. Find how it ended, and which field was the problem.
OUTPUT RUNTOT - 3
You've cleaned the amount in the input file, so every payment is a number. Submit the job again.
SUBMIT 'ZB0001.DEV.JCL(RUNTOT)' - 4
Read the output of the new job.
OUTPUT RUNTOT
Remember
- S0C7 is a data exception: arithmetic on a field that is not a number.
- The program is usually fine. The data is wrong.
- The CEE3207S report names the field and what is in it.
The usual mistake
Changing the field to PIC X so the abend goes away
It hides the problem. The bad value is still in the data, and the sum is wrong or fails somewhere else.
Find where ABCDE came from and fix the data, or test IF NUMERIC before the sum
On real z/OS
Real z/OS finds the field from the offset in CEE3207S and the compiler listing, and writes a CEEDUMP. The line that names the field and its contents is added by MF/OS to help you. MF/OS raises S0C7 when a COBOL field holds non-numeric text during arithmetic; it does not model every way the hardware can raise a data exception.
Where can I practise fixing S0C7?
Right here, at ZedBank. You take a junior job at a simulated bank, meet S0C7 in real work and fix it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- AbendAn abnormal end: a program stopping in an uncontrolled way rather than finishing and reporting a result.
- Job stepOne program execution within a job. A job is simply a sequence of steps that run in order.
- Return codeA number a program leaves behind saying how it went. Zero for clean, higher numbers for warnings and failures.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.