Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 13: CICS Recovery, Restart and Production Support


Abend Handling

An abend is an abnormal end of a task. CICS assigns every abend a code that tells you exactly what went wrong - learning to read these codes is the core skill of CICS production support.

Types of abends

  • Program check abends (ASRA) happen when the program does something the hardware forbids - bad addresses, bad data, divide by zero.
  • Exceptional condition abends (AEI*) happen when a CICS command hits an unusual situation and no RESP option was coded - for example AEIM (NOTFND) or AEIS (NOTOPEN).
  • Transaction abends (AICA runaway, AKCT timeout, AKC3 purge, ATCH deadlock, APCT program not found) describe task-level problems.
  • When a task abends, CICS writes messages to MSGUSR, usually takes a dump, and backs out the task's unit of work.

Handling abends in the program

  • The cheapest defense is the RESP option on every CICS command - it turns most exceptional conditions into testable return codes.
  • EXEC CICS HANDLE CONDITION routes named conditions to error paragraphs without abending the task.
  • EXEC CICS HANDLE ABEND catches any abend in the task and gives your program one last chance to clean up:-
    EXEC CICS
    HANDLE ABEND LABEL(9000-ABEND-PARA)
    END-EXEC.
    .
    .
    9000-ABEND-PARA.
    EXEC CICS SYNCPOINT ROLLBACK END-EXEC.
    MOVE 'Transaction failed. Please contact support.' TO MSGO.
    EXEC CICS
    SEND MAP('ERRMAP') MAPSET('ERRSET') ERASE
    END-EXEC.
    EXEC CICS RETURN END-EXEC.
  • Keep the abend handler simple - it runs in a fragile state, so just roll back, inform the user and end cleanly.

Finding the cause of an abend

  • Start with the abend code in the MSGUSR log or on the user's screen - it narrows the search immediately.
  • Use CEDF (the execution diagnostic facility) to step through the program and watch each CICS command execute.
  • For ASRA and storage problems, format the transaction dump with IPCS and look at the PSW and registers.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant