Mainframe Path Start learning free
Core7 min readLesson 3 of 4

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

AreaCommandsNotes
ScreenSEND MAP, RECEIVE MAP, SEND TEXTBMS map handling
FilesREAD, WRITE, REWRITE, DELETE, STARTBR / READNEXT / ENDBRBrowse commands read sequentially through a VSAM file
ProgramLINK, XCTL, RETURNLINK returns to you; XCTL does not
StorageGETMAIN, FREEMAINRarely needed in modern application code
QueuesWRITEQ TS / READQ TS, WRITEQ TDTemporary storage for scratch data between tasks
TimeASKTIME, FORMATTIME, DELAY, STARTSTART schedules another transaction
RecoverySYNCPOINT, SYNCPOINT ROLLBACKCommit 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

AbendMeansUsually caused by
AEI0 / AEIxAn unhandled CICS conditionA command failed and no RESP or HANDLE was coded
ASRAA program check inside your programThe CICS equivalent of an S0C7 or S0C4 — bad data or a bad reference
AEY9The resource manager is not availableDB2 attachment down, or the region not connected
APCTProgram not foundNot defined to CICS, or disabled, or not in the library
AKCT / AKCSTask timed out waiting for terminal inputA conversational design, or a user who walked away
AICARunaway taskA loop; CICS stopped it to protect the region
ATNI / AZI6Terminal errorThe session dropped

Where to look when it fails

  1. The CICS message log for the DFH message — it names the transaction, the program and the abend code.
  2. The transaction dump, if dumps are enabled for that code.
  3. CEMT INQUIRE to check the program is enabled and the file is open.
  4. 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

Using XCTL when you needed LINK

Control never returns, so anything after it never runs.

Leaving a browse open

STARTBR without ENDBR holds position and resources. Always pair them.

Writing to a file with COBOL I/O instead of CICS commands

It bypasses recovery entirely, so a failed task leaves the file updated and everything else backed out.

Blaming CICS for an ASRA

ASRA is a program check in your code. The cause is almost always the data it was given.

What you will see at work

Key terms

Check your understanding.
Take this lesson's quiz and save your progress. Free.

Take the lesson quiz
← Pseudo-conversational programmingScreens, maps and the modern front ends →