The commands and abends you will meet
CICS programming is a set of EXEC CICS commands grouped by what they touch: the screen, files, other programs, storage, and time. Twenty commands cover the great majority of application code.
By category
| Area | Commands | Notes |
|---|---|---|
| Screen | SEND MAP, RECEIVE MAP, SEND TEXT | BMS map handling |
| Files | READ, WRITE, REWRITE, DELETE, STARTBR / READNEXT / ENDBR | Browse commands read sequentially through a VSAM file |
| Program | LINK, XCTL, RETURN | LINK returns to you; XCTL does not |
| Storage | GETMAIN, FREEMAIN | Rarely needed in modern application code |
| Queues | WRITEQ TS / READQ TS, WRITEQ TD | Temporary storage for scratch data between tasks |
| Time | ASKTIME, FORMATTIME, DELAY, START | START schedules another transaction |
| Recovery | SYNCPOINT, SYNCPOINT ROLLBACK | Commit and back out |
Recovery is automatic, and that is the point
Everything a task does to recoverable resources — VSAM files defined as recoverable, DB2 tables, temporary storage queues marked recoverable — is part of one unit of work. If the task abends, CICS backs all of it out. This is why online updates that fail leave no half-finished state, and it is the strongest argument for using CICS file commands rather than anything else.
The abends you will see
| Abend | Means | Usually caused by |
|---|---|---|
| AEI0 / AEIx | An unhandled CICS condition | A command failed and no RESP or HANDLE was coded |
| ASRA | A program check inside your program | The CICS equivalent of an S0C7 or S0C4 — bad data or a bad reference |
| AEY9 | The resource manager is not available | DB2 attachment down, or the region not connected |
| APCT | Program not found | Not defined to CICS, or disabled, or not in the library |
| AKCT / AKCS | Task timed out waiting for terminal input | A conversational design, or a user who walked away |
| AICA | Runaway task | A loop; CICS stopped it to protect the region |
| ATNI / AZI6 | Terminal error | The session dropped |
Where to look when it fails
- The CICS message log for the DFH message — it names the transaction, the program and the abend code.
- The transaction dump, if dumps are enabled for that code.
- CEMT INQUIRE to check the program is enabled and the file is open.
- The commarea contents in the dump — often the fastest way to see what the previous screen sent.
DFH-prefixed messages are CICS's own. The four characters after DFH identify the component, which narrows the problem quickly: DFHAC messages are about transaction attach, DFHFC about file control, DFHTM about terminals.
Common mistakes
Control never returns, so anything after it never runs.
STARTBR without ENDBR holds position and resources. Always pair them.
It bypasses recovery entirely, so a failed task leaves the file updated and everything else backed out.
ASRA is a program check in your code. The cause is almost always the data it was given.
What you will see at work
- The message log is the first place to look, and DFH message IDs are searchable and precise.
- Temporary storage queues are handy and easy to abuse; unmanaged queues fill up and cause region-wide problems.
- Most application teams have a standard error-handling program that every transaction links to. Use it.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.