Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 8: CICS Program and Data Passing


CHANNEL

What is a CHANNEL

  • A CHANNEL is a named path that carries data between CICS programs.
  • Instead of one flat COMMAREA, a channel carries many named pieces of data called CONTAINERs.
  • You load the channel with PUT CONTAINER commands, then pass it with the CHANNEL option.
  • Channels can be used on LINK, XCTL, START and RETURN commands.
  • The receiving program reads each piece with GET CONTAINER.
  • Channels do not need any definition in CICS tables. Just use a name up to 16 characters.

Passing a channel to another program

  • First load each data item into the channel with PUT CONTAINER(container-name) CHANNEL(channel-name).
  • Then invoke the program with LINK PROGRAM('name') CHANNEL(channel-name).
  • The called program reads the items with GET CONTAINER.
  • The called program can also change a container. The caller then reads the new value with GET CONTAINER.
  • Example:-
    EXEC CICS PUT CONTAINER(CUSTOMER-NO) CHANNEL(INQUIRY-CHANNEL) END-EXEC. EXEC CICS PUT CONTAINER(BRANCH-NO) CHANNEL(INQUIRY-CHANNEL) END-EXEC. EXEC CICS LINK PROGRAM('SERVER1') CHANNEL(INQUIRY-CHANNEL) END-EXEC. EXEC CICS GET CONTAINER(CUSTOMER-RECORD) CHANNEL(INQUIRY-CHANNEL) END-EXEC.

Why CHANNEL is better than COMMAREA

  • A COMMAREA is one flat block with a fixed layout. Both programs must agree on every byte.
  • A channel holds separate named containers, so each program picks only what it needs.
  • Adding a new container does not break existing programs, unlike changing a COMMAREA layout.
  • Channels can pass much larger amounts of data than a COMMAREA.
  • The called program can update a container and the caller sees the new value.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant