CICS abend

AICB: RETRIEVE WAIT issued during shutdown

An AICB abend means a task issued EXEC CICS RETRIEVE with the WAIT option after CICS had begun to shut down, and no START data was ready for it. CICS won't let a task start a new wait for data during shutdown, so it abends the task instead.

Other names for this code

Also written as AICB abend, CICS AICB, abend AICB, AICB RETRIEVE WAIT, AICB shutdown.

What it means

EXEC CICS START can pass data to the transaction it starts, and the started task reads that data with RETRIEVE. When several STARTs for the same transaction and terminal pile up, one task can loop on RETRIEVE and read them all. Normally RETRIEVE raises ENDDATA once there is nothing left. With the WAIT option, it instead puts the task to sleep until more expired data arrives. That lets a task act as a long-running server for a terminal or connection.

Shutdown changes this. A task that is already waiting in RETRIEVE WAIT when CICS enters shutdown gets the ENDDATA condition, so it can finish cleanly. A task that issues a new RETRIEVE WAIT during shutdown, when no data is available, gets AICB instead. ENDDATA also covers a task whose wait runs past its deadlock timeout with no data arriving.

IBM also notes that RETRIEVE WAIT must be coded with at least one other option, and that it can create inter-transaction affinities that get in the way of dynamic transaction routing.

Common causes

  • A server-style transaction loops on RETRIEVE WAIT. It finishes one piece of work while shutdown is under way, issues RETRIEVE WAIT again, and finds nothing to read.
  • A transaction is started late, after shutdown has begun, and its first action is RETRIEVE WAIT with no data queued for it.
  • The program doesn't treat ENDDATA as a signal to stop, so it goes round its loop once more and issues another RETRIEVE WAIT.

How to find the problem

  1. Check the region's message log for the time shutdown began and the time of the DFHAC message for the AICB. The abend comes after the start of shutdown.
  2. Search the program named in the dump for RETRIEVE commands with the WAIT option.
  3. Look at how the program handles ENDDATA, and at what it does after each item of work.
  4. Check whether any programs in the shutdown program list table (PLT) start transactions that use RETRIEVE WAIT.

How to fix it

  • Before each RETRIEVE WAIT, have the program check whether CICS is shutting down. EXEC CICS INQUIRE SYSTEM CICSSTATUS returns values such as ACTIVE and FIRSTQUIESCE, and the program can end cleanly when the region is no longer ACTIVE.
  • Treat ENDDATA as the end of the loop, and return instead of retrying.
  • Use a shutdown PLT program to tell long-running server tasks to finish, for example by setting a flag they check between items.
  • Consider whether the program needs RETRIEVE WAIT at all, given the affinities it creates for dynamic routing.

IBM documentation

IBM documentation: AICB. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Why did one task get ENDDATA and another get AICB?

A task already waiting in RETRIEVE WAIT when shutdown starts gets ENDDATA. A task that issues a new RETRIEVE WAIT during shutdown, with no data available, gets AICB.

Can AICB happen while the region is running normally?

IBM ties AICB to RETRIEVE WAIT issued during shutdown. A RETRIEVE WAIT that runs too long in normal running raises ENDDATA when the deadlock timeout passes.

Is an AICB at shutdown harmful?

Usually it costs a dump and a log message, and any updates in the task's unit of work are backed out. It is still worth fixing, because the noise can hide real problems during shutdown.