What does EIB is used for? What EIBRESP code consist of? What is the JCL used for executing CICS and COBOL along with DB2?
QUESTION POSED ON: 10 FEB 2006
QUESTION ANSWERED BY: Robert Crawford
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
|