Problem solve Get help with specific problems with your technologies, process and projects.

Can I 'call' a CICS COBOL module from a batch COBOL program?

Find out what happens when you try to make a call to a CICS COBOL module from a batch COBOL program.

Is it possible to pass parameters and make a "call" to a CICS COBOL module from a batch COBOL program in a batch environment? 

The short answer is no. I've done this accidentally and what happens is the CICS program gets a S0C1 abend when it makes its first call.

That being said, there are ways to write programs so they can run in batch and CICS. However, the program does need to be aware of its environment to avoid issuing any CICS commands. Fortunately, LE provides a couple of functions that can tell you where the program is running. I would look through the LE bookshelf to find out more about the available functions.

CICS also provides the External Call Interface (EXCI) through which batch jobs can use to communicate with programs running in CICS. A series of EXCI calls builds a communication "pipe" to a CICS region. Through that pipe you can link to a program that will actually execute in CICS. You pass parameters to the program through a COMMAREA just as if the calling program were in CICS, too. Consult the CICS External Call Interface manual (SC34-6006-10) for more information.

Dig Deeper on IBM system z and mainframe systems