In the CICS environment (on IBM mainframe) not all the COBOL statements are available. For example the DISPLAY instruction and the COBOL instructions to manage files must be substituted by suitable EXEC CICS statements.
This difference between BATCH e CICS environments, make difficult to develop common components for both contexts, in fact no standard ways exist to query the run-time environment.
At this internet address:
a sample of COBOL program, to directly query the MVS control blocks, is available. Precisely the sample exhibit the searched environment by the variable named BATCH-OR-CICS.
As soon as the environment has been identified, different sub-programs, customized for the environments, can be called to obtain the required result.
The above-mentioned sample show also how to access other interesting informations such as jobmane, jobclass, programname, userid, etc.
I have successfully experimented the technique.
Regards
This difference between BATCH e CICS environments, make difficult to develop common components for both contexts, in fact no standard ways exist to query the run-time environment.
At this internet address:
a sample of COBOL program, to directly query the MVS control blocks, is available. Precisely the sample exhibit the searched environment by the variable named BATCH-OR-CICS.
As soon as the environment has been identified, different sub-programs, customized for the environments, can be called to obtain the required result.
The above-mentioned sample show also how to access other interesting informations such as jobmane, jobclass, programname, userid, etc.
I have successfully experimented the technique.
Regards