Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO DISTINGUISH BATCH AND CICS ENVIRONMENTS WITH COBOL

Status
Not open for further replies.

dcptnapx

Programmer
Mar 3, 2003
5
IT
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
 
Hi,

That GSF code, and others like it, have been around for a while now. It's very handy to access IBM OS internal info. One caveat, though. If IBM changes the location of any of the fields referenced in the code, then you face an abend or getting invalid data.

Granted, that the possibility is remote, but it can (and did) happen. For example, in later releases, the technique for finding a DSN changed dramatically.

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top