These questions and answers originally appeared on TechTarget's Expert Answer Center as part of Robert Crawford's two-week tenure as the on-demand expert in January to February 2006. During this time, he was available @18636 to quickly answer questions on CICS application performance and design, as well as to write daily blog entries. Keep an eye on the Expert Answer Center for topics that could help your IT shop.
I am currently working on a POC, and we're looking for a way to invoke Web services from a batch job running in z/OS (V1R7). We know COBOL doesn't have a Web services capability, but perhaps we can invoke a Web services API from a C/C++ program or Java via BPXBATCH. Any ideas? Examples? Any help you can provide would be greatly appreciated.
I don't have any examples or experience handy, but it seems very doable to invoke a Java program using BPXBATCH. You should be able to invoke a C++ program right from the JCL without the Unix shell. I'm sorry, but other than that I don't have any advice unless you want to use CICS External Call Interface (EXCI) to call a program in CICS from batch. The CICS program could invoke Web services from there.
What does EIB is used for? What EIBRESP code consist of? What is the JCL used for executing CICS and COBOL along with DB2?
The EXEC Interface Block (EIB) is the main means of communication between an application program and CICS. It includes fields that identify the transaction code, terminal and number of the current task. The EIB also has fields containing the results of the execution of CICS commands.
EIBRESP is one of those fields that gets set CICS command execution. You may also look in EIBRESP2 for further information about the command's results. EIBRESP and EIBRESP2 work best used when you specify the NOHANDLE, RESP() or RESP2() parameters on a CICS command. In most situations CICS will return control back to your program where you can check the results. This works much better than the old "HANDLE CONDITION" technique that was difficult to follow and sometimes caused programs to act unpredictably.
EIBRESP and EIBRESP2 are four-byte numbers. If the command executed normally they will be zero. However, if the results are non-zero, CICS supplies a kind of macro function call DFHRESP that maps a condition's name with its numeric code. I called it a macro function, but it actually works for all the supported languages. For instance, after a file control call you can compare EIBRESP against DFHRESP(NOTFND). The CICS translator will substitute the numeric code for NOTFND in the source going to the compiler.
Both CICS and DB2 have precompilers (or command translators) that transform the commands into calls, which are then fed into the compiler in a subsequent step. CICS/TS 2.2 included a command translator integrated into the LE compiler. Not only did this mean a CICS program could be compiled in one step, it also allowed programmers to include CICS commands and structures in copy books. The JCL for translating and compiling a CICS/DB2 program varies quite a bit from shop to shop. For more information I suggest you consult the CICS Application Programming Reference Manual (APRM) or the CICS Application Programming Guide (APG).
Editor's Note: For more information on EIB, see Losing EIB information.