Call sub-program in batch and online
Posted: Wed Mar 01, 2023 11:48 am
Before asking question, let me detail about the programs in picture.
Program A - Main program
Program B - sub-program - COBOL + IMS.
Program C - sub-program - COBOL + DB2.
Program D - sub-program - COBOL + DB2.
Note - Program C & D have same logic. The difference is that..
a. Program D has CICS statements in case DB2 logic fails and program C does not have any CICS statements.
b. Program C is compiled with CICS option as 'N'. While, Program D is compiled with CICS option as 'Y'
Main program A calls sub-program B. Program B is calling 2 sub-programs - C & D.
Program B is compiled with CICS option as 'Y'.
Question-
We are trying to call Program B in batch, but it fails with S0C1 in the IMS call. To resolve it, we set the CICS option as 'N' during compilation and then executed in batch and it worked fine. But, then the same version failed while executing in CICS region.
This is obviously because of CICS flag being 'N' during compilation.
Is there a way we can compile / modify Program B to execute in both batch and online mode?
Program A - Main program
Program B - sub-program - COBOL + IMS.
Program C - sub-program - COBOL + DB2.
Program D - sub-program - COBOL + DB2.
Note - Program C & D have same logic. The difference is that..
a. Program D has CICS statements in case DB2 logic fails and program C does not have any CICS statements.
b. Program C is compiled with CICS option as 'N'. While, Program D is compiled with CICS option as 'Y'
Main program A calls sub-program B. Program B is calling 2 sub-programs - C & D.
Program B is compiled with CICS option as 'Y'.
Question-
We are trying to call Program B in batch, but it fails with S0C1 in the IMS call. To resolve it, we set the CICS option as 'N' during compilation and then executed in batch and it worked fine. But, then the same version failed while executing in CICS region.
This is obviously because of CICS flag being 'N' during compilation.
Is there a way we can compile / modify Program B to execute in both batch and online mode?