CICS Channels & Containers (Mainframe Subsystem Support)
In legacy IBM CICS application design, programs communicate across program links (EXEC CICS LINK, XCTL) and asynchronous task starts (EXEC CICS START) using the Communication Area (COMMAREA). [1]
Read the full briefing
1. Capability Overview & Problem It Solves
In legacy IBM CICS application design, programs communicate across program links (EXEC CICS LINK, XCTL) and asynchronous task starts (EXEC CICS START) using the Communication Area (COMMAREA).
However, the COMMAREA is constrained by a 16-bit halfword binary length descriptor to a maximum size of 32,767 bytes (32 KB). Passing large modern business payloads, multi-record tables, complex XML/JSON documents, or multiple distinct records previously forced developers to engineer complex data segmentation routines, write temporary staging records to Temporary Storage Queues (TSQs), or issue multiple chained calls.
Channels and Containers eliminate the 32 KB COMMAREA limit entirely (CICS Program Call with Channels and Containers). A Channel acts as a named parameter collection (similar to an envelope or briefcase), and a Container is an individual named data block of arbitrary size (ranging from single bytes to gigabytes) held within that channel.
Rocket Enterprise Server delivers full mainframe-compatible emulation of Channels and Containers across online CICS transactions, Distributed Program Links (DPL), and CICS Web Services (CWS).
2. Architecture & How It Works
- Multi-Container Data Packaging:
- Rather than flattening multiple unrelated data structures into an offset-delimited single COMMAREA, programs can create multiple named containers within a single channel (e.g., container
CUSTOMER-HDR, containerITEMS-LIST, containerSECURITY-TOKEN). - Programs pass the channel using the
CHANNEL(name)parameter onEXEC CICS LINK,XCTL,START, orRETURNstatements. - In the called program, the passed channel becomes the current channel. The program retrieves specific containers by name without needing to understand or parse the byte offsets of unrelated data structures.
- Rather than flattening multiple unrelated data structures into an offset-delimited single COMMAREA, programs can create multiple named containers within a single channel (e.g., container
- Data Types & Code Page Conversion (
CHARvs.BIT): Containers are typed to manage character encoding across distributed platforms (CCSID Conversion Tables - Rocket Software Documentation):DATATYPE(CHAR): Declares that the container contains text. When passing containers across heterogeneous nodes, DPL connections, or web service boundaries, Enterprise Server automatically converts the character payload between the source CCSID (e.g., EBCDICIBM-37) and the target CCSID (e.g., ASCIIIBM-437or UTF-8).DATATYPE(BIT): Declares raw binary data (such as packed-decimal fieldsCOMP-3, binary integersCOMP, or encrypted byte arrays). Enterprise Server preserves bit streams verbatim without code page transcoding.
- Lifecycle and Memory Optimization:
- Unlike TS queues, which require explicit deletion to prevent storage leaks, containers associated with an executive channel are automatically scoped to the task lifecycle and freed when the task terminates.
- Programs can execute
EXEC CICS MOVE CONTAINERto transfer data ownership between containers without allocating duplicate memory buffers, accelerating high-volume data pipeline processing.
3. Key Syntax, Configuration & Operational Directives
- Populating Containers and Calling a Program (
PUT CONTAINER&LINK):
WORKING-STORAGE SECTION.
01 WS-CUST-RECORD.
05 CUST-ID PIC X(10) VALUE 'CUST000100'.
05 CUST-NAME PIC X(30) VALUE 'ACME CORPORATION'.
01 WS-ORDER-DATA PIC X(50000).
01 WS-RESP PIC S9(8) COMP.
...
PROCEDURE DIVISION.
* Create character container (undergoes CCSID conversion if shipped)
EXEC CICS PUT CONTAINER('CUST-INFO')
CHANNEL('ORDER-CHANNEL')
FROM(WS-CUST-RECORD)
FLENGTH(LENGTH OF WS-CUST-RECORD)
CHAR
RESP(WS-RESP)
END-EXEC.
* Create binary container for large payload (> 32 KB)
EXEC CICS PUT CONTAINER('ORDER-ITEMS')
CHANNEL('ORDER-CHANNEL')
FROM(WS-ORDER-DATA)
FLENGTH(LENGTH OF WS-ORDER-DATA)
BIT
RESP(WS-RESP)
END-EXEC.
* Link to target program passing the channel
EXEC CICS LINK PROGRAM('ORDPROC')
CHANNEL('ORDER-CHANNEL')
RESP(WS-RESP)
END-EXEC.- Reading Containers in the Target Program (
GET CONTAINER):
WORKING-STORAGE SECTION.
01 WS-CUST-IN PIC X(40).
01 WS-ACTUAL-LEN PIC S9(8) COMP.
01 WS-RESP PIC S9(8) COMP.
...
PROCEDURE DIVISION.
* Retrieve the customer information container from current channel
EXEC CICS GET CONTAINER('CUST-INFO')
INTO(WS-CUST-IN)
FLENGTH(WS-ACTUAL-LEN)
RESP(WS-RESP)
END-EXEC.- CCSID Configuration in ESCWA: When using character containers across ASCII-configured Enterprise Server regions, ensure the EBCDIC Local CCSID and ASCII CCSID mapping is defined in the region's System Initialization Table (SIT) and verified with the
MFCCSIDMAPmodule (CCSID Conversion Tables - Rocket Software Documentation).
4. Reference Citations (Rocket Documentation 12.0)
- CICS Program Call with Channels and Containers — Enterprise Server / COBOL Server 12.0 for UNIX
- CCSID Conversion Tables - Rocket Software Documentation — Enterprise Server 12.0 for UNIX