Start of changeStart of change

Creating a channel

About this task

You create a channel by naming it on one of the following commands:

If the channel doesn't already exist, within the current program scope, it is created.

The most straightforward way to create a channel, and populate it with containers of data, is to issue a succession of EXEC CICS PUT CONTAINER(container-name) CHANNEL(channel-name) FROM(data_area) commands. The first PUT command creates the channel (if it doesn't already exist), and adds a container to it; the subsequent commands add further containers to the channel. If the containers already exist, their contents are overwritten by the new data.

An alternative way to add containers to a channel is to move them from another channel. To do this, use the following command:

EXEC CICS MOVE CONTAINER(container-name) AS(container-new-name)
     CHANNEL(channel-name1) TOCHANNEL(channel-name2)

Note:
  1. If the CHANNEL or TOCHANNEL option isn't specified, the current channel is implied.
  2. The source channel must be in program scope.
  3. If the target channel doesn't already exist, within the current program scope, it is created.
  4. If the source container doesn't exist, an error occurs.
  5. If the target container doesn't already exist, it is created; if it already exists, its contents are overwritten.

You can use MOVE CONTAINER, instead of GET CONTAINER and PUT CONTAINER, as a more efficient way of transferring data between channels.

If the channel named on the following commands doesn't already exist, within the current program scope, an empty channel is created:

End of changeEnd of change [[ Contents Previous Page | Next Page Index ]]