Module 1: Abend Codes
ASRA- CICS Program Check
ASRA is the CICS program-check abend - the CICS equivalent of the S0C7, S0C4 and S0C1 batch abends.
What it means
- ASRA means a program check interrupt happened inside a CICS task: data exception, protection exception, operation exception and similar hardware interrupts.
- CICS catches the interrupt and abends the transaction with ASRA instead of letting the whole region fail.
- The terminal user usually sees "TRANSACTION xxxx FAILED WITH ABEND ASRA".
Common causes
- The same causes as the batch abends: bad numeric data (like S0C7), writing into protected storage (like S0C4), or executing a bad instruction (like S0C1).
- Moving non-numeric data into a numeric field and then using it in arithmetic.
- Storing into a COMMAREA or container area beyond its defined length.
- A subscript or index going out of table bounds.
How to find it
- Check the CICS log for message DFHAP0001, which records the ASRA with the program name and the interrupt type.
- Take a transaction dump and inspect the failing instruction offset and the data areas.
- Use CEDF to step through the transaction interactively and watch the abend happen at the exact statement.
How to fix it
- Code EXEC CICS HANDLE ABEND to trap the ASRA and route to an error paragraph instead of dumping the transaction to the user.
- Then fix the real bug: the bad data, the out-of-bounds subscript, or the storage overwrite.
- Validate numeric fields with NUMERIC tests before arithmetic, and keep COMMAREA lengths in sync.
Example
- Trap the ASRA with HANDLE ABEND so the program gets control instead of abending the transaction:-
PROCEDURE DIVISION. MAIN-PARA. EXEC CICS HANDLE ABEND LABEL(ERR-PARA) END-EXEC. EXEC CICS RECEIVE MAP('MAP1') MAPSET('MYMAP') END-EXEC. COMPUTE WS-TOTAL = WS-AMT-IN * WS-RATE. EXEC CICS SEND MAP('MAP1') MAPSET('MYMAP') ERASE END-EXEC. EXEC CICS RETURN END-EXEC. ERR-PARA. EXEC CICS SEND TEXT FROM('SORRY - AN ERROR OCCURRED') ERASE END-EXEC. EXEC CICS RETURN END-EXEC.
- If WS-AMT-IN holds spaces instead of a number, the COMPUTE causes a data exception and ASRA - validate it first:-
IF WS-AMT-IN IS NUMERIC COMPUTE WS-TOTAL = WS-AMT-IN * WS-RATE ELSE MOVE 0 TO WS-TOTAL END-IF.
