Previous Topic: Components of a Batch Job StreamNext Topic: Components of a VSE Batch Job Stream


Batch Job Stream in z/OS

An example in z/OS of a job stream to compile and run a program follows:

//COMP1 JOB . . . //BATCH EXEC IDLBATCH,PARM.IDEAL='NOPRINT' //IDEAL.SYSPRINT DD SYSOUT=(W,,SMAL) //IDEAL.COMPLIST DD SYSOUT=A //IDEAL.RUNLIST DD SYSOUT=A //IDEAL.SYSIN DD * SIGNON PERSON userid PASSWORD password PRODUCT IDEAL SELECT SYSTEM DOC COMPILE COMP1 VERSION 1 DESTINATION SYS name RUN COMP1 VERSION 1 DESTINATION SYS name OFF //

In this example, the DESTINATION clause of the RUN command is shown as a system printer. This example also shows a DD record for a report where the ddname (COMPLIST) corresponds to the name of the compile report produced in this run.

You can monitor the status of a report directed to the output library by displaying the output library. As soon as the program starts to execute, the report's status in the library is CRTIN. When the status is READY, the report is released from the batch process.

The following standard JCL statements are used in the z/OS environment to execute CA Ideal in batch.

// JOB

Identifies a standard JOB statement containing information about the job for the operating system.

If your site uses an external security system to control access to a CA Ideal, the USER= parameter on this statement must specify a security ID that is authorized to access a CA Ideal. Do not include the CA Ideal SIGNON statement when external security is used.

// EXEC IDLBATCH,PARM.IDEAL='NOPRINT'

Identifies a JCL PROC containing the CA Ideal batch JCL for a batch session. These statements are described in the following paragraphs. IDLBATCH is the default name of the PROC as installed. See your CA Ideal Administrator for the correct name for your site.

The parameter PARM.IDEAL='NOPRINT' is optional. If you leave out this parameter or assign a null value ('') to it, the SYSPRINT file contains a simulated CA Ideal panel as a response to each command in the batch job stream. Including the parameter with the value NOPRINT suppresses the simulated panels and prints only the commands entered and the messages produced.

You can use the COND parameter with an EXEC statement to check the value associated with a batch job step. You can use condition codes to ensure that no step runs unless the previous steps executed successfully.

For example, you can define the following steps in a batch job:


 //STEP1 EXEC IDLBATCH
   ...
   RUN ABC PROD               :May set $RC to 12.
   OFF

 //STEP2 EXEC,COND=(12,LE)
   ...                        :Bypass if 12 is
   RUN XYZ PROD               :less than or equal to the
   OFF                        :return code from any
                              :prior step.
 //STEP3 EXEC,COND=(12,LE)
   ...
   RUN PQR PROD
   OFF

//

If program ABC encounters an error that sets the $RETURN‑CODE to 12, then programs XYZ and PQR do not run. If the $RETURN‑CODE is set to 12 in program XYZ, program PQR does not run in STEP 3. For a list of condition codes, see Terminating a Run later in this chapter. For further information regarding $RETURN‑CODE and default or defined error procedures, see the Programming Reference Guide.

//SYSIN DD

Identifies a data set containing CA Ideal commands executed (normally //SYSIN DD *, which means immediately following). The CA Ideal commands are entered in a sequence that simulates an online session. For example, a SIGNON command is the initial command that simulates the signon panel and OFF is the final command.

//SYSPRINT DD (optional)

Identifies a data set (normally SYSOUT) meant to receive the listing of the CA Ideal batch session. This output includes an image of each command and resulting panel with one page per transaction. This statement is provided in the IDLBATCH PROC, but you can override it.

//report DD (optional)

You are required to write a DD statement for each report generated by a program run in batch. The ddname must be the unique one‑ to eight‑character report name. These DD statements are not provided in the procedure named in the EXEC record. If no DD statement is provided for the report, then the DD statement //AUXPRINT DD SYSOUT=A, which is supplied in the IDBATCH PROC, is used for all reports.

If you do not supply DD records for reports and a RUN produces several reports in parallel, the reports can be intermingled in the AUXPRINT listing.

//COMPLIST DD (optional)

Identifies a data set (normally SYSOUT) meant to receive the compilation listing of all programs compiled in the batch sequence of commands. This statement is provided in the IDLBATCH PROC, but you can modify it.

//RUNLIST DD (optional)

Identifies a data set (normally SYSOUT) meant to receive data generated by a LIST statement in the procedure of a CA Ideal program. This JCL record is provided in IDLBATCH, but you can override it.

//PRTLIST DD (optional)

Identifies a default data set (normally SYSOUT) to receive any data printed using CA Ideal PRINT commands. This JCL record is provided in IDLBATCH, but you can override it. If you use the NAME parameter in a PRINT command, the parameter specified indicates the alternate DD record name.

//seqfilename DD

Identifies the one‑ to eight‑character name for a sequential file used by an application. CA Ideal provides the ddname as the FILENAME in the dataview comment when the dataview is displayed.

According to the rules of z/OS JCL, overriding DD statements must appear in the same order as the DD statements in IDLBATCH.