Creating a channel

You can create a channel by naming it on one of a number of API commands. If the channel does not exist in the current program scope, CICS® creates it.

About this task

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

  • LINK PROGRAM CHANNEL
  • MOVE CONTAINER CHANNEL TOCHANNEL
  • PUT CONTAINER CHANNEL
  • PUT64 CONTAINER
  • RETURN TRANSID CHANNEL
  • START TRANSID CHANNEL
  • XCTL PROGRAM CHANNEL
  • WEB RECEIVE TOCHANNEL
  • WEB CONVERSE TOCHANNEL
  • RUN TRANSID CHANNEL

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 does not exist), and adds a container to it; the subsequent commands add further containers to the channel. If the containers exist, their contents are overwritten by the new data.

AMODE (64) programs can create and use channels in the same way, by using EXEC CICS PUT64 CONTAINER commands. This command is for use only in non-Language Environment (LE) AMODE(64) assembler language application programs.

Note: New channels remain in scope until the link level changes , except for the transaction channel, which has the name DFHTRANSACTION. The transaction channel does not go out of scope when the link level changes: it is always accessible in the transaction . For more information about channel scope, see The scope of a channel.

Do not give a channel a name that starts with the characters DFH , apart from those that CICS defines as part of its API. These channels must be used only as described by that API.

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 is not specified, the current channel is implied.
  2. The source channel must be in program scope.
  3. If the target channel does not exist in the current program scope, it is created.
  4. If the source container does not exist, an error occurs.
  5. If the target container does not exist, it is created; if the target container exists, its contents are overwritten.
  6. When a channel is created, it exists until it goes out of scope. Any storage that is associated with it, either containers or set storage, also exists until the channel goes out of scope.
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 does not exist in the current program scope, an empty channel is created:

  • EXEC CICS LINK PROGRAM CHANNEL( channel-name )
  • EXEC CICS RETURN TRANSID CHANNEL( channel-name )
  • EXEC CICS START TRANSID CHANNEL( channel-name )
  • EXEC CICS XCTL PROGRAM CHANNEL( channel-name )
  • EXEC CICS RUN TRANSID CHANNEL( channel-name )


dfhp3_ch_createif.html | Timestamp icon Last updated: Monday, 5 June 2017