0% found this document useful (0 votes)
107 views7 pages

Commarea Vs Container

Uploaded by

LuisCaridad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views7 pages

Commarea Vs Container

Uploaded by

LuisCaridad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

USANDO COMMAREA USANDO CONTAINER

PROG1

EXEC CICS LINK PROGRAM(PROG2) EXEC CICS PUT CONTAINER(structure-name)


COMMAREA(structure) CHANNEL(channel-name) FROM(structure)
… EXEC CICS LINK PROGRAM(PRO2)
RETURN CHANNEL(channel-name) .
.
.
EXEC CICS GET CONTAINER(structure-name)
CHANNEL(channel-name) INTO(structure)

RETURN

PROG2
EXEC CICS GET CONTAINER(structure-name)
EXEC CICS ADDRESS COMMAREA(structure)
INTO(structure)
...
.
RETURN
.
EXEC CICS PUT CONTAINER(structure-name)
FROM(structure)

RETURN
Channels and containers

Containers are named blocks of data, designed for passing


information between programs. Programs can pass any number
of containers between each other.

Containers are grouped in sets that are called channels . A


channel is analogous to a parameter list.

To create named containers and assign them to a channel, a


program uses EXEC CICS PUT CONTAINER ( container-name )
CHANNEL ( channel-name ) commands.

It can then pass the channel and its containers to a second


program by using the CHANNEL( channel-name ) option of the
EXEC CICS LINK , XCTL , START , RUN TRANSID or RETURN
commands.
The second program can read containers that are passed to it
using the EXEC CICS GET CONTAINER ( container-name )
command. This command reads the named container that
belongs to the channel that the program was invoked with.

If the second program is called by an EXEC CICS LINK command,


it can also return containers to the calling program. It can do
this by creating new containers, or by reusing existing
containers.
Channels and containers are visible only to the program that
creates them and the programs they are passed to, or (for EXEC
CICS FETCH CHANNEL commands) the program which fetches
the channel. When these programs end, CICS® automatically
destroys the containers and their storage. Programs can also
issue commands to delete channels and containers before that
time.

AMODE (64) programs can use channels and containers to


transfer data in 64-bit storage in the same way, by using EXEC
CICS PUT64 CONTAINER and EXEC CICS GET64 CONTAINER
commands. These commands are for use only in non- Language
Environment® (LE) AMODE(64) assembly language application
programs, and CICS business transaction services (BTS)
containers are not supported.

Channel containers are not recoverable. Pseudoconversational


transactions that are started with RETURN TRANSID CHANNEL()
cannot be restarted. If you must use recoverable containers,
use CICS business transaction services (BTS) containers.
The following commands are supported: EXEC CICS DELETE
CHANNEL , EXEC CICS DELETE CONTAINER , EXEC CICS GET
CONTAINER , EXEC CICS MOVE CONTAINER , and EXEC CICS PUT
CONTAINER .
example of a program that creates a channel and passes it to a second program
IDENTIFICATION DIVISION. * INITIALISE CUSTOMER RECORD
PROGRAM-ID. CLIENT1. *
WORKING-STORAGE SECTION. ... CREATE CUSTNO and BRANCHNO
COPY INQINTC *
* copybook INQINTC * GET CUSTOMER RECORD
* Channel name *
* 01 INQUIRY-CHANNEL PIC X(16) VALUE 'inqcustrec'. EXEC CICS PUT CONTAINER(CUSTOMER-NO) CHANNEL(INQUIRY-
* Container names CHANNEL) FROM(CUSTNO) FLENGTH(LENGTH OF CUSTNO) END-
* 01 CUSTOMER-NO PIC X(16) VALUE 'custno'. EXEC
* 01 BRANCH-NO PIC X(16) VALUE 'branchno'. EXEC CICS PUT CONTAINER(BRANCH-NO) CHANNEL(INQUIRY-
* 01 CUSTOMER-RECORD PIC X(16) VALUE 'custrec'. CHANNEL) FROM(BRANCHNO) FLENGTH(LENGTH OF BRANCHNO)
* Define the data fields used by the program END-EXEC
* 01 CUSTNO PIC X(8). EXEC CICS LINK PROGRAM('SERVER1') CHANNEL(INQUIRY-
* 01 BRANCHNO PIC X(5). CHANNEL) END-EXEC
* 01 CREC. EXEC CICS GET CONTAINER(CUSTOMER-RECORD)
* 02 CUSTNAME PIC X(80). CHANNEL(INQUIRY-CHANNEL) INTO(CREC) END-EXEC
* 02 CUSTADDR1 PIC X(80). *
* 02 CUSTADDR2 PIC X(80). * PROCESS CUSTOMER RECORD
* 02 CUSTADDR3 PIC X(80). *
PROCEDURE DIVISION. ... FURTHER PROCESSING USING CUSTNAME and CUSTADDR1 etc...
MAIN-PROCESSING SECTION. EXEC CICS RETURN END-EXEC

EXIT.
example of a linked to program that retrieves data from the channel it has been passed.
IDENTIFICATION DIVISION. PROCEDURE DIVISION.
PROGRAM-ID. SERVER1. MAIN-PROCESSING SECTION.

WORKING-STORAGE SECTION. EXEC CICS GET CONTAINER(CUSTOMER-NO) INTO(CUSTNO)


END-EXEC
COPY INQINTC EXEC CICS GET CONTAINER(BRANCH-NO) INTO(BRANCHNO)
* copybook INQINTC END-EXEC
* Channel name
* 01 INQUIRY-CHANNEL PIC X(16) VALUE 'inqcustrec'. ... USE CUSTNO AND BRANCHNO TO FIND CREC IN A DATABASE
* Container names
* 01 CUSTOMER-NO PIC X(16) VALUE 'custno'. EXEC CICS PUT CONTAINER(CUSTOMER-RECORD) FROM(CREC)
* 01 BRANCH-NO PIC X(16) VALUE 'branchno'. FLENGTH(LENGTH OF CREC) END-EXEC
* 01 CUSTOMER-RECORD PIC X(16) VALUE 'custrec'.
* Define the data fields used by the program EXEC CICS RETURN END-EXEC
* 01 CUSTNO PIC X(8).
* 01 BRANCHNO PIC X(5). EXIT.
* 01 CREC.
* 02 CUSTNAME PIC X(80).
* 02 CUSTADDR1 PIC X(80).
* 02 CUSTADDR2 PIC X(80).
* 02 CUSTADDR3 PIC X(80).

You might also like