There are many situations where user has to trigger CICS transaction via batch jobs. This becomes handy when any CICS program is being coded and situation occurs to allocate/de-allocate files.
However, there is one installation required up hand for CICS to accept the commands from batch; the console definition must be defined in the terminal table. Sample console definitions are provided by IBM supplied resource group DFH$CNSL. You would require your CICS administrator to set up if not done.
Use the MODIFY command to trigger the
transaction from a batch job. MODIFY command is abbreviated to F.
Example: Following JCL launches the transaction
TXN1 in the CICS region CICRGN1
//CICSBTCH
JOB …
//STEP001
EXEC ...
//
………..
//STEP002
EXEC PGM=IEFBR14
//
COMMAND 'F CICRGN11,TRA1'
//*
Note
i) The MVS command is directly executed
without waiting for the completion of the STEP001.
ii) The above command triggers the
transaction TRA1 in the region CICRGN11.
iii) The command must be placed between
quotes.
To avoid the execution of the command
before the completion of STEP001, launch the MVS command in separate job.
Example:
//BTCHSUB
JOB ......
//STEP001
EXEC ......
//
--------
//STEP002 EXEC PGM=IEBGENER
//SYSPRINT
DD SYSOUT=*
//SYSUT1 DD DATA,DLM=@@
//CICSBTCH JOB ……
//STEPR EXEC PGM=IEFBR14
// COMMAND 'F CICRGN11,TRA1'
//SYSUT2
DD SYSOUT=(A,INTRDR)
//SYSIN
DD DUMMY
//*
In the above job, STEP002 submits the
batch interface job (CICSBTCH) to internal reader upon the completion of the
step STEP001. Thus the transaction TRA1 is triggered only after the completion
of STEP001.