What it means
Code 0C7 is the program check for a data exception. In business programs it means a decimal instruction (add, subtract, multiply, divide, compare or convert) found bytes that are not a valid decimal number, so the processor refused to continue.
A valid packed field has digits 0-9 in every half-byte except the last, which holds the sign. Spaces (X'40') and low-values (X'00') are not valid numbers. The failure is data-dependent: the same record fails every time.
Valid vs invalid bytes
VALID · PIC S9(5) COMP-3
Digits, then sign C: +1234.
INVALID · SAME FIELD HOLDING SPACES
The first five half-bytes are valid digits, but the last one, 0, is not a sign (A–F), so the field is not valid packed decimal.
Typical causes
- A numeric field was never initialised and holds spaces or low-values.
- An alphanumeric or group item was moved into a numeric field.
- The input record layout differs from the copybook the program uses.
- A file transfer damaged packed fields or changed their encoding.
- A REDEFINES treats character data as numeric.
How to fix it
- Map the offset in the symptom dump to the statement in the compile listing.
- List every numeric field that statement uses.
- Find the record being processed and browse it in hex to see the bad bytes.
- Trace where the field was last set: a READ, MOVE or initialisation.
- Fix the data or add validation (IF field IS NUMERIC) before arithmetic.
- Check that outputs from the failed run are cleaned up before you rerun.
Example
Illustrative only; names and values are invented.
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0C7 REASON CODE=00000007
IEF450I PAYJOB01 STEP020 - ABEND=S0C7 U0000 REASON=00000007