CICS Troubleshooting
AICA runaway task condition
AICA means a runaway task: a CICS transaction used too much CPU without returning control, so CICS killed it.
What it means
- CICS watches task CPU via DTIMOUT; a task that never yields looks like an infinite loop.
- It protects the region — one looping task must not stall everyone.
Common causes
- Genuine infinite loop in the application program.
- Loop exit condition that can never be met with certain input data.
- Very large file browse without yielding control periodically.
How to diagnose
- Check CSMT for AICA and identify the transaction and program.
- Review the program for loops; check the exit conditions against production data.
- Reproduce with the same input in a test region.
How to fix it
- Fix the loop termination logic.
- For long-running legitimate work, issue EXEC CICS SUSPEND or break work into chunks.
- Review DTIMOUT settings with the systems team if the workload is genuinely long.
Example: Guarantee loop termination
* Every loop needs a reachable exit:
PERFORM UNTIL WS-EOF = "Y" OR WS-COUNT > 99999
... read next ...
ADD 1 TO WS-COUNT
END-PERFORM.
A safety counter turns an infinite loop into a detectable error.
Interview tip
- Q: How would you troubleshoot a AICA runaway task condition in production?
- A: I would identify the looping transaction from CSMT, review its loop exit conditions against the failing input, fix the termination logic, and consider periodic SUSPEND for long tasks.
Prevention checklist
- Code reviews focused on loop exits.
- Safety counters on unbounded loops.
- Test with production-scale data.
