Ask the Expert

Can I 'call' 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?

    Requires Free Membership to View

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.

This was first published in January 2006

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.