I want to have a COBOL/IMS subprogram called from either CICS or batch environments. Is it possible to exclude...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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 IBM system z and mainframe systems
Related Q&A from Robert Crawford
I have two years of experience in mainframe technology, currently working as a mainframe developer. I want to change to Java technology.continue reading
I want to replicate DB2 from the mainframe to an AIX box since it's cheaper and the copy can be used for testing. Is this possible?continue reading
What's the impact on I/O when you run in a CPU-constrained mainframe environment?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.