CICSintermediate

COMMAREA for Inter-Program Communication

Understand how COMMAREA passes data between CICS programs and preserves state across pseudo-conversational transaction turns.

COMMAREA (communication area) is CICS's original, still widely used mechanism for passing data both between programs in a single logical transaction and, critically, across separate task invocations of the same pseudo-conversational transaction. Because CICS working-storage doesn't naturally persist between a user's screen interactions, COMMAREA is the classic answer to 'how does a multi-screen CICS transaction remember what the user already entered on the previous screen?'

COMMAREA is a claim ticket you hand back to a coat check between visits — the attendant (CICS) holds onto your coat (the data) between your comings and goings, and hands it right back to you the next time you show up with the matching ticket, even though you left the building in between.

Key Concepts

1
When program A calls program B via EXEC CICS LINK or XCTL, it can pass a COMMAREA — a contiguous block of data — that program B's LINKAGE SECTION picks up via the DFHCOMMAREA special register, giving B access to whatever data A chose to pass without any shared file or database round-trip. This is the primary parameter-passing mechanism for CICS program-to-program calls, conceptually similar to passing arguments in a CALL but scoped to CICS's own linking model.
2
For preserving state across a pseudo-conversational transaction's separate task invocations (screen 1, user thinks, presses enter, screen 2 — each screen being a genuinely separate task under the covers), the program returns control to CICS via EXEC CICS RETURN, specifying both the next transaction ID to resume (TRANSID) and a COMMAREA to carry forward — CICS holds onto that data and hands it back as the new task's DFHCOMMAREA when the user's next input triggers the resumed transaction.
3
A classic interview distinction is COMMAREA versus channels/containers (the newer mechanism): COMMAREA is a single, size-limited (historically 32K, though later extended) contiguous block with no inherent structure beyond what the LINKAGE SECTION imposes, while channels/containers allow multiple independently-named, more flexible data areas — understanding why more complex modern CICS applications often prefer channels for readability and avoiding COMMAREA layout versioning headaches is a strong signal of real-world experience.