Ask the Expert

How to call COBOL/IMS from CICS or batch?

I want to have a COBOL/IMS subprogram called from either CICS or batch environments. Is it possible to exclude CICS commands from the subprogram? The CICS program uses addressability and the batch uses BATCH PSB. Would this be possible to do? Any idea where I can get more info on this?

Requires Free Membership to View

You cannot do this as COBOL does not have a macro facility. The best you can do is to split up ALL (and I mean everything) into distinct blocks and then have two programs that COPY in the pieces you want. One compiles with different JCL for batch and CICS and as the included items are placed in different libraries, you get what you want by using differing libraries in the JCL.

All in all, too much bother to get right -- best to have distinct programs and put up with a bit of duplication.

This was first published in December 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: