COMMAREA in LINK and XCTL commands

A communication area (COMMAREA) is a facility used to transfer information between two programs within a transaction, or between two transactions from the same terminal.

For information about using COMMAREA between transactions, see Using the COMMAREA in RETURN commands.

Information in COMMAREA is available only to the two participating programs, unless those programs explicitly make the data available to other programs that might be invoked later in the transaction.
  • When one program links to another, the COMMAREA can be any data area to which the linking program has access. It is often in the working storage or LINKAGE SECTION of that program. In this area, the linking program can both pass data to the program it is invoking and receive results from that program.
  • When a program transfers control (an XCTL command) to another, CICS® might copy the specified COMMAREA into a new area of storage, because the invoking program and its control blocks might no longer be available after it transfers control.

In both cases, the address of the area is passed to the program that is receiving control, and the CICS command-level interface sets up addressability. See Program control for further information.

When XCTL is used, CICS ensures that any COMMAREA is addressable by the program that receives it, by creating the COMMAREA in an area that conforms to the addressing mode of the receiving program. If the receiver is AMODE(24), the COMMAREA is created below the 16 MB line, and if the receiver is AMODE(31), the COMMAREA is created above 16 MB but below 2 GB.

The COMMAREA is copied to USERKEY storage where necessary, depending on the addressing mode and EXECKEY attributes of the receiving program. See Storage control for more information about EXECKEY.

CICS contains algorithms designed to reduce the number of bytes to be transmitted. The algorithms remove some trailing binary zeros from the COMMAREA before transmission and restore them after transmission. The operation of these algorithms is transparent to the application programs, which always see the full-size COMMAREA.

The overhead for using COMMAREA in an LINK command is minimal; it is slightly more with the XCTL and RETURN commands, when CICS creates the COMMAREA from a larger area of storage used by the program.

Tip: Instead of using a communication area (COMMAREA), a more modern method of transferring data between CICS programs is to use a channel. Channels have several advantages over COMMAREAs (see Benefits of channels). To pass a channel on a LINK or XCTL command, you use the CHANNEL option in place of the COMMAREA option. Channels are described in Transferring data between programs using channels.