Figure 51 shows a CICS client program that:
* create the employee container on the payroll-2004 channel
EXEC CICS PUT CONTAINER('employee') CHANNEL('payroll-2004') FROM('John Doe')
* create the wage container on the payroll-2004 channel
EXEC CICS PUT CONTAINER('wage') CHANNEL('payroll-2004') FROM('100')
* invoke the payroll service, passing the payroll-2004 channel
EXEC CICS LINK PROGRAM('PAYR') CHANNEL('payroll-2004')
* examine the status returned on the payroll-2004 channel
EXEC CICS GET CONTAINER('status') CHANNEL('payroll-2004') INTO(stat)
Figure 52 shows part of the PAYR server program invoked by the client. The server program:
"PAYR", CICS COBOL server program
* discover which channel I've been invoked with
EXEC CICS ASSIGN CHANNEL(ch_name)
:
WHEN ch_name 'payroll-2004'
* my current channel is "payroll-2004"
* get the employee passed into this program
EXEC CICS GET CONTAINER('employee') INTO(emp)
* get the wage for this employee
EXEC CICS GET CONTAINER('wage') INTO(wge)
:
* process the input data
:
:
* return the status to the caller by creating the status container
* on the payroll channel and putting a value in it
EXEC CICS PUT CONTAINER('status') FROM('OK')
:
:
WHEN ch_name 'payroll-2005'
* my current channel is "payroll-2005"
:
:
: