Key Takeaways: CICS Fundamentals

  1. CICS is a transaction processing monitor that manages thousands of concurrent users, screen I/O, file access, and transaction integrity. It sits between the terminal (or modern client) and your COBOL application program.

  2. Pseudo-conversational design is the fundamental CICS pattern. The program sends a screen and ends; a new task starts when the user responds. This conserves resources because tasks are active only during processing, not during user think time. The COMMAREA bridges state between tasks.

  3. The COMMAREA is your only state bridge between pseudo-conversational interactions. Keep it small (CICS stores it in shared memory for all concurrent users), include a state flag to track which screen/phase the user is in, and always check EIBCALEN to distinguish first invocation (= 0) from subsequent returns (> 0).

  4. BMS maps define screen layouts using DFHMSD (mapset), DFHMDI (map), and DFHMDF (field) macros. They generate two outputs: a physical map (load module for screen formatting) and a symbolic map (COBOL copybook for data access). Named fields have I/O/L/F suffixes for input, output, length, and flag.

  5. Always initialize the output map area before populating it. Residual data from previous interactions causes "ghost data" — one of the most common CICS display bugs.

  6. Check EIBAID to determine which key the user pressed. Use EVALUATE with DFHAID symbolic constants. Always handle at minimum: Enter, PF3 (exit), Clear (reset), and an OTHER case for unexpected keys.

  7. Use RESP/RESP2 for error handling, not HANDLE CONDITION. RESP puts the error check directly after the command, making control flow explicit and readable. Always handle MAPFAIL on RECEIVE MAP.

  8. Never use STOP RUN, COBOL file I/O, or DISPLAY in CICS. Use GOBACK or RETURN instead of STOP RUN. Use EXEC CICS file commands instead of OPEN/READ/WRITE. Use WRITEQ TD for debug logging.

  9. XCTL transfers control without returning (like GOTO between programs). LINK calls and returns (like PERFORM). Use XCTL for navigation between transaction modules; use LINK for calling utility or validation subroutines.

  10. CICS manages the unit of work. Avoid explicit EXEC SQL COMMIT in CICS programs. CICS issues a SYNCPOINT at task end. Explicit commits can desynchronize the CICS and DB2 units of work.

  11. CICS is not legacy — it is evolving. Modern CICS supports REST APIs, JSON, event streaming, Liberty/Java integration, and cloud deployment. The COBOL programs you write today can serve 3270 terminals and mobile apps simultaneously without code changes.

  12. The EIB (Execute Interface Block) is your context dashboard. EIBCALEN tells you if this is a first or returning invocation. EIBAID tells you which key was pressed. EIBTRMID and EIBTRNID identify the terminal and transaction. Check the EIB before processing any request.