As with any CICS application, our case study and any other COBOL/VSE programs wanting to be executed in both the batch and CICS environments will need to first be passed through the CICS translator. The CICS language interface stub, DFHELII, also needs to be included at link-edit time to provide HLAPI support in the CICS environment.
It’s also important to ensure that the link-edited PHASE has an entry point of the COBOL routine. This will, in the majority of cases, be done automatically. However, it’s worth pointing out as one of the things to check when developing a new application to be used in both the CICS and batch environments.
The COBOL/VSE sample program used in this article case study is available for download. The sample code and compiling JCL are available at ftp://public.dhe.ibm.com/eserver/zseries/zos/vse/download/COBJOURN.txt. This sample includes JCL that can be used to compile, link-edit, and execute (in the batch environment) the case study program and be used as a template for development of new environment-independent COBOL/VSE applications.
The JCL provided in Figure 9 includes execution of the case study in the batch environment. Three separate LSTQ output members will be produced. The first is the CICS translator output, the second is the compile and link-edit output, and the final member will contain the batch execution output and console log.
To run the case study in a CICS environment, you will need to define a transaction that has the case study program defined as the target, define the case study as a program, and then make the site-dependent security adjustments to allow for the transaction to be executed. Install the relevant CICS group using the CEDA transaction and then invoke the transaction. The CICS output log, operator console, and terminal used to execute the transaction should all be reviewed to see the complete execution flow.
Case Study CICS Definitions
Following are some sample DFHCSDUP definitions that could be used to define the case study for execution under CICS:
DEFINE PROGRAM(COBJOUR) GROUP(???) LANGUAGE(COBOL)
DEFINE TRANS(COBJ) PROGRAM(COBJOUR) GROUP(???)
- Don’t use any COBOL verbs that may result in operating system functions being invoked. This restriction applies to both the CICS and batch logic flow of an environment-independent application; for example, ACCEPT/OPEN/CLOSE/READ/WRITE/REWRITE, etc. A complete list is available in the CICS Application Programming Guide (SC33-1657-03) under “COBOL Considerations” and “Restrictions.”
- All environment-independent COBOL programs must be compiled with the RENT option and DATA(31). Enabling and using the WORD(CICS) compiler option is also recommended. See the COBOL/VSE Installation and Customization Guide.