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?
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.
Dig Deeper on Mainframe operating systems and management
Related Q&A from Robert Crawford
With 3270 bridge, you can't stack input messages into one structure. The bridge can't process them all at once. It takes a little more work.continue reading
CICS expert Robert Crawford offers advice on determining the connection between CICS transactions and MQ Queue name.continue reading
CICS expert Robert Crawford discusses if a program can use IXLLIST macros in CICS when IXLLIST are APF.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.