Generating Utility JCL

 <  Day Day Up  >  

In this chapter, all the sample JCL for the online utilities use DSNUPROC , a generic utility procedure supplied with DB2.

Recall from Chapter 18, "The Doors to DB2," that online DB2 utilities can be controlled by DB2I option 8. The DB2I utility panels are shown in Figures 30.1 and 30.2. JCL to execute DB2 utilities can be generated by these DB2I panels.

Figure 30.1. DB2I utility JCL generation panel 1.
graphics/30fig01.gif

Figure 30.2. DB2I utility JCL generation panel 2.
graphics/30fig02.gif

The first panel, shown in Figure 30.1, is set to generate JCL for the STOSPACE utility. The second panel, shown in Figure 30.2, provides additional information used by certain DB2 utilities. If the first panel were set to generate JCL for the COPY , LOAD , or REORG utilities, the second panel would prompt the user to enter data set names required for those utilities.

The DB2I utility JCL generation panels provide four basic options:

SUBMIT

JCL is automatically built to execute the requested DB2 utility, and it is submitted in batch for processing.

EDITJCL

JCL is automatically built and displayed for the user. The user can edit the JCL, if desired, and then submit the JCL.

DISPLAY

The status of a utility identified by JOB ID is displayed online.

TERMINATE

A utility identified by JOB ID is terminated . This cancels a running utility or removes an inactive utility from the DB2 subsystem, thereby disabling future restartability for the utility.


The DISPLAY and TERMINATE options are merely menu-driven implementations of the DB2 -DISPLAY and - TERM commands. The SUBMIT and EDITJCL options provide automated DB2 utility JCL generation and submission. The DB2I utility program provides only rudimentary DB2 utility JCL, however. It works as follows :

  1. The user specifies either SUBMIT or EDITJCL and a JOB ID that uniquely identifies a utility.

  2. The user specifies one of the supported utilities (see Figure 30.1).

  3. The user then specifies on the panel the data set containing the utility control cards to be used. The data set must be pre-allocated.

  4. As directed by the panel, the user supplies additional data set names, depending on the selected utility.

  5. JCL is generated for the requested utility.

The DB2I utility generator displays the output messages shown in Figure 30.3 when Enter is pressed and the request is processed .

Figure 30.3. DB2I JCL generation output messages.
graphics/30fig03.gif

The JCL generated by DB2I for the STOSPACE utility is shown in Figure 30.4. Generating JCL for a utility each time it is required, however, can be cumbersome. Many users create a partitioned data set containing sample utility JCL that they can modify as needed. The examples in Part VI can be used as templates for the creation of DB2 utility JCL for use in your shop.

Figure 30.4. Generated JCL for the STOSPACE utility.
graphics/30fig04.gif

Each online utility is associated with a utility identifier, or UID, that is passed to DSNUTILB as a parameter to uniquely identify the utility to DB2. Two utilities with the same UID cannot execute concurrently.

The DSNUPROC procedure requires the specification of override parameters to function properly. These parameters should be coded as follows:

LIB

The DB2 link library assigned to your DB2 system. This can be obtained from the database administrator or the system programmer responsible for DB2.

SYSTEM

The DB2 system containing the objects on which the utility will be run.

UID

Identifies the utility to the DB2 system. If this value is blank, the UID defaults to the job name . This enables an analyst or DBA to quickly identify the job associated with a utility. Also, because two identically named MVS jobs cannot run concurrently, two utilities with the same UID cannot run concurrently. This minimizes the possibility of incorrectly restarting or rerunning an abending job.

UTPROC

This value initially should be blank (that is, UTPROC=" ). This parameter is assigned a value only during restart. A value of 'RESTART(PHASE)' restarts the utility at the beginning of the last executed phase. A value of 'RESTART' restarts the utility at the last or current commit point. The type of restart, PHASE or COMMIT , must be determined by analyzing the type of utility and the abend.


 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net