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.
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.
EXEC CICS MOVE CONTAINER(
container-name
) AS(
container-new-name
)
CHANNEL(
channel-name1
) TOCHANNEL(
channel-name2
)
- If the CHANNEL or TOCHANNEL option is not specified, the current channel is implied.
- The source channel must be in program scope.
- If the target channel does not exist in the current program scope, it is created.
- If the source container does not exist, an error occurs.
- If the target container does not exist, it is created; if the target container exists, its contents are overwritten.
- 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.
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 )