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

Module 8: CICS Program and Data Passing


CONTAINER

What is a CONTAINER

  • A CONTAINER is a named block of data that lives inside a CHANNEL.
  • Each container has a name of up to 16 characters.
  • A channel can hold many containers, each with its own name and data.
  • Containers replace the single flat COMMAREA with separate named pieces of data.
  • You create and fill a container with PUT CONTAINER, and read it with GET CONTAINER.
  • A container can hold character data or binary data.

The CONTAINER commands

  • PUT CONTAINER creates a container and puts data into it. Use FROM(data-area) to name the source.
  • GET CONTAINER reads a container into your working storage. Use INTO(data-area) to name the target.
  • MOVE CONTAINER renames a container or moves it to another channel.
  • DELETE CONTAINER removes a container from the channel.
  • All four commands take the CHANNEL(channel-name) option.
  • Example of reading a container in the called program:-
    EXEC CICS GET CONTAINER(CUSTOMER-NO) CHANNEL(INQUIRY-CHANNEL) INTO(CUST-NO-FIELD) END-EXEC. EXEC CICS GET CONTAINER(BRANCH-NO) CHANNEL(INQUIRY-CHANNEL) INTO(BRANCH-NO-FIELD) END-EXEC. * ... process ... EXEC CICS PUT CONTAINER(CUSTOMER-RECORD) CHANNEL(INQUIRY-CHANNEL) FROM(CUST-RECORD-AREA) END-EXEC.

Rules for using containers

  • PUT CONTAINER must run before the container can be read by GET CONTAINER.
  • The first PUT CONTAINER creates the channel automatically. You do not define channels anywhere.
  • Container names must match exactly between the PUT and the GET.
  • Use DELETE CONTAINER to clean up containers you no longer need.
  • Both the caller and the called program can PUT and GET containers on the same channel.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant