What it means
Code 0C4 covers several storage-access program checks. The reason code tells you which: 4 means a protection exception (the storage key does not match the program's key), X'10' is a segment-translation exception and X'11' is a page-translation exception (the address is not backed by storage the program obtained).
In COBOL this nearly always means a field was reached through a bad address: a subscript out of range, a LINKAGE SECTION item with nothing behind it, a pointer that was never set, or a record area of a closed file. Language Environment reports it as CEE3204S.
Typical causes
- A subscript or index ran past the end of an OCCURS table.
- A CALL parameter list that does not match the called program's LINKAGE SECTION.
- Using a file's record area before OPEN or after CLOSE.
- A pointer or base address that was never set, or was overwritten.
- Reference modification with a bad start position or length.
- Storage that was already freed and then used again.
How to fix it
- Note the reason code, the module and the offset from the symptom dump.
- Map the offset to a statement in the compile listing of the exact module that ran.
- Check every subscript, pointer and LINKAGE item used by that statement.
- Compare each CALL with the called program's parameter layout, field by field.
- Recompile in test with SSRANGE so out-of-range subscripts give a clear message.
- Rerun only after checking whether partial updates need backing out.
Example
Illustrative only; names and values are invented.
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004
CEE3204S The system detected a protection exception (System Completion Code=0C4).
IEF450I CUSTJOB1 STEP030 - ABEND=S0C4 U0000 REASON=00000004