How do I interact with a transaction from a batch program?
From CICS Wiki
Contents |
Interact with a CICS transaction from Batch
As always there are several ways to this. I just try to share what I know so far but it's not limited, perhaps there are other mehods too which I just forget. The order of methods doesn't reflect the best way it's just the order I know and have used in the past
EXCI
Since several versions CICS provide the so called EXCI feature and this can be used to invoke commarea based programs from a Batch environment. Starting with RRMS you can also run this CICS-program as part of your "unit of work [LUW]]". However this requires some changes in your batch application. See EXCI-Samples for more details
DB2-Trigger
Since DB2 version 7 you can trigger CICS-pograms. Look at DSNACICS for more details or just edit this article and share your experience.
MQSeries
You can write a MQueue and trigger a CICS transaction.
OP-sys-Command
Some installation invoke a CICS transaction via the MVS Modify command (or VSE the console) like
MVS-flavour: F cicsid,xxxx VSE-flavour: // EXEC DTRIATTN,PARM='MSG CICSID,DATA=xxx'
Unfortunally your application doesn't know if the transaction runs successfully. This is why we get rid of them and convert to EXCI. Well for limited CEMT commands you might check the EXCI-Samples and download my sample. Of course it doesn't provide the full CEMT functionality as the SPI is limited. However it may cover our needs. If you expand the code please be so kind and email yur update so everbody can participate!!.
SOAP
Since CTS 3.1 you can invoke CICS-programs via the SOAP-feature as CTS can act as service-provider. Unfortunally such kind of process isn't part of your LUW like EXCI.
Roland 14:12, 7 December 2007 (CST)
3rd party Vendor Software
BatchCICS-Connect - 24x7 Integration
I prefer to use 3rd party BatchCICS-Connect. It installs with a working cobol program that runs CEMT commands from batch job control. By using simple EXEC type statements, I can write my own customized batch code to fully interact with CEMT or any other CICS transaction, including BMS applications. This allows me to input data, test for successful completion, and/or extract information using logical navigation of the 3270 screens. You can reference fields by row/col, or if BMS screens, you can use the actual BMS map field names.
In addition, I can code these same EXEC statements in a CICS program, which in turn, could be invoked by some other process.
| EXEC HBI OPEN APPLID ('CICSXXXX') END-EXEC.
| MOVE 'SET FILE(FILEA) CLOSE DISABLE'
| TO WS-CEMT-INPUT.
| EXEC HBI RUN TRANSACTION ('CEMT')
| INBOUND (WS-CEMT-INPUT)
| OUTBOUND FIELDS (FIELD-R23-C14)
| END-EXEC.
| IF HBI-EIBRESP > ZEROS
| MOVE HBI-EIBRESP TO RESP-CODE
| DISPLAY 'HBI RUN ERRS'
| DISPLAY 'HBI-EIBRESP IS >' RESP-CODE
| MOVE 99 TO RETURN-CODE
| GO TO 1000-EXIT
| ELSE
| DISPLAY 'CEMT FILE CLOSE REQUEST, RESPONSE IS>'
| FIELD-R23-C14
| END-IF.
| * RESPOND TO CEMT SCREEN AND END THE TRNX
| EXEC HBI REPLY AID ('PF3') QUIT
| END-EXEC.
| EXEC HBI CLOSE APPLID ('CICSXXXX') END-EXEC.
Earl 18:46, 7 December 2007 (CST)
CSKL
The CICS listener provided by IBM can be used. The batch program connects to the CICS region via an IP socket and invokes a "child server" transaction. This transaction can then exchange data with the batch program through regular sockets programming.
You can find the fine manual that describes the CICS side of such at z/OS Communications Server IP CICS Sockets Guide. The batch side of things is described in z/OS Communications Server IP Sockets Application Programming Interface Guide and Reference.
Jantje 12:34, 10 August 2009 (CST)
