I’ve seen this kind of thing come up several times … There are resources within CICS that some process running outside of CICS needs to access. How can you do it? One answer is EXCI … This will be a brief introduction to EXCI.
EXCI refers to the External CICS Interface. This interface has been around for a long time and it allows a non-CICS program to call a CICS program, and pass information back and forth via the programs’ commarea. The non-CICS program (often a batch program) is considered the “client”, and the CICS program is considered the “server.”
Programming Interface.
The applications programmer would need to choose the programming interface to be used by the client program. There are two types of programming interfaces – the EXCI CALL interface, and the EXEC CICS interface. The EXEC CICS interface is the simpler method, but would be less efficient if a large number of calls were to be performed. The EXCI CALL interface is more difficult to understand and code, but is much more efficient, especially if a large number of calls are to be made.
The EXCI CALL interface consists of six commands, which are detailed in the CICS External Interfaces Guide:
- Initialize-User
- Allocate-Pipe
- Open-Pipe
- DPL call
- Close-Pipe
- Deallocate-Pipe
The first three commands establish a connection from the non-CICS client program to the CICS server program, and the final two commands close the connection. Once a connection to the server program is established, as many DPL (Distributed Program Link) calls can be made as desired before closing the connection.
The EXEC CICS interface has only one command – EXEC CICS LINK PROGRAM – which performs all six commands of the EXCI CALL interface in one invocation. So a connection has to be established and closed for each call, where with the EXCI CALL interface, the connection is established and closed once.
There is really nothing special about the server program – it is just an ordinary commarea program, and is totally unaware that it is being called from outside of CICS.
There are sample client programs in the SDFHSAMP library from the CICS installation in Assembler (DFH$AXCC), COBOL (DFH0CXCC), PL/I (DFH$PXCC), and C (DFH$DXCC). The only sample server program in the SDFHSAMP library is in Assembler (DFH$AXCS), but remember that the server is nothing more than an ordinary commarea program.
Systems Interface.
To support a given EXCI application, the CICS Systems Programmer would have to define the system interface. The system interface is a connection/session pair, similar to those set up for MRO or LU6.2 communications. There are two different types of interfaces – generic and specific. There can be only one generic interface per CICS region, and multiple EXCI programs can use it. Multiple specific interfaces can be defined in a given CICS region, and only one specific client program can use each one.
There are sample connection/session definitions for generic and specific EXCI interfaces in the DFH$EXCI group. You may want to consider putting the SDFHEXCI library in the Link List, or else it will be required to be concatenated to the JOBLIB or STEPLIB in the client’s JCL.
Limitation.
Since the EXCI interface utilizes commarea, it is restricted to the same 32K limit that the commarea has. I look for IBM to update the EXCI interface, or to introduce a new interface, that can take advantage of channels and containers. Until then, it will be necessary to utilize a non-CICS facility, such as MQ, to pass more than 32K between a CICS program and a non-CICS program.
Summary.
EXCI is a convenient way to call a CICS program from a non-CICS program. The CICS External Interfaces Guide will have all the details necessary for implementing, but this post will hopefully give you a good idea of what it’s all about before you dig into that.