Assembly / HLASM · Abend code

Abend S0C4

What does Abend S0C4 mean in Assembly / HLASM?

Protection exception (reason code 4) is the classic case, but the official manual lists S0C4 as covering several other, quite different exceptions identified only by their SDWA reason code: segment-translation (10), page-translation (11), ASTE-validity (2B), ASCE-type (38), and Region-First/Second/Third (39, 3A, 3B) exceptions. The protection case is what most assembler programmers know it as: the key of the storage area referenced doesn't match the key the program is running under, most often from a base register that got overwritten by ordinary code so USING no longer matches what the register actually holds, from a module link-edited as reentrant without actually following reentrancy rules, or from trying to execute instructions out of storage that was obtained with EXECUTABLE=NO. The translation-exception reason codes instead point at storage that was never actually GETMAINed, or that was paged out while a disabled program tried to reference it.

Abend S0C4z/OS · HLASM

Condition

Protection exception (reason code 4) is the classic case, but the official manual lists S0C4 as covering several other, quite different exceptions identified only by their SDWA reason code: segment-translation (10), page-translation (11), ASTE-validity (2B), ASCE-type (38), and Region-First/Second/Third (39, 3A, 3B) exceptions. The protection case is what most assembler programmers know it as: the key of the storage area referenced doesn't match the key the program is running under, most often from a base register that got overwritten by ordinary code so USING no longer matches what the register actually holds, from a module link-edited as reentrant without actually following reentrancy rules, or from trying to execute instructions out of storage that was obtained with EXECUTABLE=NO. The translation-exception reason codes instead point at storage that was never actually GETMAINed, or that was paged out while a disabled program tried to reference it.

Fix

Check the SDWA/dump reason code first, since it tells you which of these unrelated problems actually happened. For reason code 4, check every instruction that loads a value into a register also used as a base register for a stray overwrite, and check whether the module's actual link-edit attributes (reentrant or not, storage key, executable) match how it's coded and how it's running. For the translation reason codes (10, 11, 2B, 38, 39, 3A, 3B), check that the storage being referenced was actually obtained before use, and that a program running disabled page-fixed any storage it touches instead of leaving it pageable.

Related abend code