Previous topic |
Next topic |
Contents |
Glossary |
Contact z/OS |
PDF
JCL EXEC statements: What are JCL procedures? Reusable JCL collection |
|
Some programs and tasks require a larger amount of JCL than a user can easily enter. JCL for these functions can be kept in procedure libraries. A procedure library member contains only part of the JCL for a given task--usually the fixed, unchanging part of JCL. The user of the procedure supplies the variable part of the JCL for a specific job. In other words, a JCL procedure is like a macro. Such a procedure is sometimes known as a cataloged procedure. A cataloged procedure is not related to the system catalog; rather, the name is a carryover from another operating system. The following code shows an example of a JCL procedure (commonly called a proc). //MYPROC PROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR,DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND In this example procedure:
If you coded JCL to use this example proc, your JCL might look like this:
//MYJOB JOB 1 //*---------------------------------* //MYPROC PROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR,DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND //*---------------------------------* //STEP1 EXEC MYPROC,SORTDSN=ZPROF.AREA.CODES //SYSIN DD * SORT FIELDS=(1,3,CH,A)In this example job:
The previous example shows how to change the value of one part of a JCL
procedure; in this case, replacing the variable &SORTDSN with
a real data set name ZPROF.AREA.CODES. In some cases, you
might need to override an entire statement within a JCL procedure. To do so,
you code a JCL PROC override statement, which is shown in this example:
//MYJOB JOB 1 //*---------------------------------* //MYPROC PROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR,DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND //*---------------------------------* //STEP1 EXEC MYPROC,SORTDSN=ZPROF.AREA.CODES //MYSORT.SORTOUT DD DSN=ZPROF.MYSORT.OUTPUT, // DISP=(NEW,CATLG) //SYSIN DD * SORT FIELDS=(1,3,CH,A)The MYSORT.SORTOUT DD statement is a procedure override that redefines the output data set as a newly created data set rather than a default data set. The stepname.ddname format tells the system to override the corresponding DD statement in the named step, within the JCL procedure. Using an override allows you to tailor the procedure for your needs, without changing its function for other users. |
Copyright IBM Corporation 1990, 2010
|