Professional Documents
Culture Documents
Course Details
Audience This course is designed for intermediate to advanced JCL system programmers, operators, and application programmers who have some knowledge of basic JCL coding. Prerequisites This course assumes that the student has basic knowledge of IS technologies, data processing, software, and hardware from OS/390 Introduction (38051), OS/390 MVS Concepts and Facilities (38052), z/OS MVS JCL Introduction (38053), and z/OS MVS JCL Intermediate courses.
Introduction
Page 2 of 72
Course Introduction
z/OS MVS JCL Advanced builds on topics covered in MVS JCL Introduction and Intermediate to present the advanced uses of procedures and utilities. The first unit, Reviewing Procedures reviews addition, override, and nullification statements that enable procedures to be modified at execution time to meet particular processing needs. The second unit, Creating Effective Procedures, examines procedures from the perspective of the procedure creator. The emphasis is on the effective use of symbolic parameters, DDNAME operands, and other coding techniques that can relieve the procedure creator of the need for extensive JCL coding. The third unit, Using Utility Programs, introduces utility programs and the JCL required to communicate with utilities. You will analyze condition codes and system error messages that provide clues to the cause of JCL and utility control statement errors. The fourth unit, Sample Utility Applications, review a range of practical applications that can be achieved with utilities. The material adopts a problem-solving approach in determining the JCL and utility control statements that are required for common processing situations.
Introduction
Page 3 of 72
Course Objectives
At the end of this course, you will be able to: Correctly code statements to execute procedures Correctly code addition, override and nullification statements to modify procedure EXEC and DD statement parameters at the time of execution Use standard notations to identify procedure statements in a listing of effective JCL Correctly code procedures using DDNAME operand and symbolic parameters
Continued
Introduction
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 4 of 72
Introduction
Page 5 of 72
UNIT
Reviewing Procedures
Topics:
Using Procedures Invoking Procedures Invoking Nested Procedures Interpreting the Effective JCL
Page 6 of 72
Introduction
Page 7 of 72
Introduction
Page 8 of 72
UNIT
Reviewing Procedures
Topics:
Using Procedures Invoking Procedures Invoking Nested Procedures Interpreting the Effective JCL
Page 9 of 72
Introduction
Page 10 of 72
Concepts
Page 11 of 72
(In-stream)
PEND
(Cataloged)
Concepts
Page 12 of 72
The PROC statement serves to isolate the procedure definition from the rest of the job stream.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 13 of 72
Review
Page 14 of 72
Which of the following begins an in-stream procedure and isolates it from the rest of the job stream? A. A PROC statement B. A PEND statement C. A procedure step
Review
Page 15 of 72
//GO
or
EXEC EXEC
PROCA PROC=PROCA
//GO
JOB
PROC A
To invoke an in-stream procedure, use the name that is identified on the PROC statement of the procedure definition. To execute a cataloged procedure, use the name under which the procedure is cataloged in the procedure library. An example of executing a cataloged procedure is shown on the right.
//GO EXEC PROC A
CATALOGED PROCEDURES
Concepts
Page 16 of 72
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 17 of 72
JOB 377-44-1247,D.ROSE PROC EXEC PGM=MYPROG DD DSN=INDATA, DISP=SHR DD SYSOUT=A PEND EXEC PGM=PROG1 DD DSN=DATA1, DISP=SHR DD SYSOUT=A EXEC PROCA
JOB 377-44-1247,D.ROSE PROC EXEC PGM=MYPROG DD DSN=INDATA, DISP=SHR DD SYSOUT=A PEND EXEC PGM=PROG1 DD DSN=DATA1, DISP=SHR DD SYSOUT=A EXEC PROCA
Notice the relationship between the JCL you code to define PROCA and the JCL that results when you execute the procedure - in the Procedure Definition and the Statement that executes the procedure. Notice that the coded JCL is in a different sequence than the Effective JCL, in the previous slide.
Concepts
Page 18 of 72
Review
Page 19 of 72
Match the following terms with their descriptions: 1. Procedure definition A. The JCL in a procedure definition combined with the JCL you code B. Pre-coded JCL with a unique name, which consists of one or more job steps C. A job step within a procedure
2. Effective JCL
3. Procedure step
Review
Page 20 of 72
Glossary
Procedures Partitioned data set Pre-coded sets of JCL with a unique name. A data set on direct access storage that is divided into partitions, called members, each of which can contain a program, part of a program, or data. A statement that begins a procedure definition and isolates it from the other JCL in a job stream. A statement that ends a procedure definition. A job step that is part of a procedure definition.
PROC statement
Glossary
Page 21 of 72
Summary
Page 22 of 72
UNIT
Reviewing Procedures
Topics:
Using Procedures Invoking Procedures Invoking Nested Procedures Interpreting the Effective JCL
Page 23 of 72
Introduction
Page 24 of 72
JOB
To obtain a procedure listing you can: Use the IEBGENER Utility Use the IEBPTPCH Utility Run a job and include TYPRUN=SCAN on the JOB statement. Within the job stream, include an EXEC statement that executes the procedure:
//MYJOB // //JSTEP
Concepts
JOB EXEC
TYPRUN=SCAN
Page 25 of 72
TIME=(3)
Page 26 of 72
One exception is the PGM parameter, which is the only EXEC statement parameter that cannot be overridden or nullified. The only way to execute a procedure with a different program is to assign a value to a symbolic PGM parameter.
Concepts
Page 27 of 72
Procedure step
New Value
//
JSTEP
EXEC
PROCEDURENAME,PARAMETER.PROCSTEPNAME=VALUE
The general form for coding changes to EXEC statement parameters is as follows: To modify EXEC statement parameters for any procedure step, append the procedure step to the parameter. If the stepname is omitted, the parameter applies to all steps of the procedure, with the exception of the PARM parameter. If the stepname is omitted when adding or overriding a PARM parameter, the PARM value only applies to the first step in the procedure. Any PARM parameters in subsequent steps within the procedure are nullified.
The general form for coding changes to EXEC statement parameters is shown above.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 28 of 72
//PSTEP1 EXEC PGM=PROG1, // TIME=(1,30) //DD1 DD DSN=INTRAN,DISP=SHR //DD2 DD DSN=MASTER,DISP=SHR //DD3 DD SYSOUT=A //DD4 DD DSN=&&VALID, // DISP=(NEW,PASS), // UNIT=SYSDA,SPACE=(TRK,(1,1)) //PSTEP2 EXEC PGM=PROG2,TIME=5 //DD5 DD DSN=&&VALID, // DISP=(OLD,DELETE) //DD6 DD SYSOUT=A
//JSTEP //
EXEC
TRANSACT, TIME.PSTEP1=3
Concepts
Page 29 of 72
Which of the following actions can you perform when a procedure is invoked for use? A. Override the PGM=parameter on one or more procedure EXEC statements B. Override operands, such as ACCT, on procedure EXEC statements
Review
Page 30 of 72
Complete the following JCL statement to invoke the procedure TRANSACT and pass a PARM value of '9/10/98' to PROG1 in PSTEP1:
Review
Page 31 of 72
Parameters with a stepname appended must appear before any parameters coded without appended stepnames.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 32 of 72
//JSTEP // // // //
These modifications are coded on the EXEC statement that invokes the procedure, as shown on the right.
Concepts
Page 33 of 72
Which of the following statements could you use to invoke the TRANSACT procedure and make the following changes: a. Revert to the installation defined CPU time for PROG2 in PSTEP2 b. Restrict the amount of time PROG1 in PSTEP1 can use the CPU to 2 minutes c. Pass a PARM value of 12/1/99 to PROG1
A. // EXEC TRANSACT,PARM.PSTEP1=12/1/99,TIME.PSTEP1=2,TIME.PSTEP2=
B. // EXEC TRANSACT,TIME.STEP2=,TIME.STEP1=2,PARM.STEP.STEP=12/1/99 C. // EXEC TRANSACT PARM.STEP=,TIME.STEP= D. // EXEC TRANSACT,TIME.PSTEP1=2,PARM.PSTEP1=12/1/99,TIME.PSTEP2=
Review
Page 34 of 72
INTRAN
VOL123435
NEWTRAN
Page 35 of 72
The first part consists of the name of the procedure step where the DD parameter to be changed occurs or to which the DD statement is to be added, followed by a period. The second part of the name is the DD statement to be overridden in the procedure step or the DDNAME defined for a data set to be added.
Specify the parameter to be changed, added, or nullified, followed by an equal sign and the value of the parameter.
Page 36 of 72
//
PROCSTEPNAME.DDNAME
DD
PARAMETER=VALUE
How to code a stepname? You can code the stepname in front of the DDNAME to override or to add. Notice that this sequence is the opposite of that used when coding EXEC statement overrides or additions. The general form for DD additions, overrides, and nullifications is shown above.
Concepts
Page 37 of 72
DD statements are added in their entirety. Overridden statements are modified parameter by parameter.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 38 of 72
// //
DCB=(BUFNO=,BLKSIZE=, RECFM=,BUFL=)
Concepts
Page 39 of 72
On which of the following statements do you specify changes to procedure data specifications: A. On the PROC statement of the procedure B. On the EXEC statement you use to invoke the procedure C. On the special DD statements you code when invoking the procedure D. On the PEND statement
Review
Page 40 of 72
PGM=PROG1 DSN=DATFIL,
PGM=PROG2
//JSTEP
EXEC
_________
2. Specify, for PROG2, a data set named INDATA. (PROG2 refers to the data set by the DDNAME TEST.)
//PSTEPB.TEST
DD
_________
Review
Page 41 of 72
Page 42 of 72
//JSTEP EXEC TRANSACT 1.//PSTEP1 DD1 DD DSN=MYDATA 2.//PSTEP1.DD2 DD DSN=CKDATA, // DISP=SHR 3.//PSTEP2.DD6 DD DSN=INVOICE, // DISP=(NEW,CATLG), // UNIT=3390, // VOL=SER=692912, // SPACE=(TRK,10)
Concepts
Page 43 of 72
//PSTEP1.DD1 DD //DD2 DD
// ddname DD
Thus, the changes to PSTEP1 in the TRANSACT procedure in the previous example could have been coded as shown on the right.
Concepts
Page 44 of 72
WRONG DATA
RIGHT DATA
INCORRECT OUTPUT
INTENDED OVERRIDE
Concepts
Page 45 of 72
DD DD DD DD
In this exercise, code the following override DD statements using the shorthand form: 1. Code an override statement to specify a data set named TEST1 instead of A.B.C
//STEPC.DD4
DD
__________
2. Code an override statement to specify a data set named TESTDATA rather than STRP
//DD5
DD
__________
3. Code an override statement to specify a data set named TEST2 instead of A.B.D
//DD7
DD
__________
Review
Page 46 of 72
Place the following override and addition DD statements in the order in which they must be specified. (Assume procedure DD statements are in alphanumeric order.) A. An override DD statement for DD6 in PSTEP3 B. An override DD statement for DD2 in PSTEP1 C. An addition DD statement for DD3 in PSTEP1 D. An addition DD statement for DD5 in PSTEP3 E. An override DD statement for DD4 in PSTEP1
Review
Page 47 of 72
IEBPTPCH Utility
TYPRUN=SCAN
Operands
Glossary
Page 48 of 72
Summary
Page 49 of 72
UNIT
Reviewing Procedures
Topics:
Using Procedures Invoking Procedures Invoking Nested Procedures Interpreting the Effective JCL
Page 50 of 72
Introduction
Page 51 of 72
Concepts
Page 52 of 72
Concepts
Page 53 of 72
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 54 of 72
EXEC DD DD
Then execute PROCA with the addition for PROCA, as shown on the right.
Concepts
Page 55 of 72
Assume that you have procedures named PROC1 to PROC12 (nested up to 12 levels). You execute PROC3 with an override EXEC statement as follows:
Review
Page 56 of 72
Summary
Page 57 of 72
UNIT
Reviewing Procedures
Topics:
Using Procedures Invoking Procedures Invoking Nested Procedures Interpreting the Effective JCL
Page 58 of 72
Introduction
Page 59 of 72
Concepts
Page 60 of 72
JOB
//MYJOB //
JOB
12,D.ROSE, MSGLEVEL=1
TRANSACT
Concepts
Page 61 of 72
Following is the JOB statement for LA$TEST2, which executes the TRANSACT procedure. Complete the JOB statement to ensure that the statements for TRANSACT will be listed in the job log.
Review
Page 62 of 72
XX X/ XX*
++ +/ ++
***
***
Special notation in columns 1,2 and 3 of the JCL listing distinguish the different categories of JCL statements. These notations are listed in the table above.
Concepts
Page 63 of 72
Concepts
Page 64 of 72
Page 65 of 72
JCL Submitted: //LA$MYJOB // //JSTEP1 //COB.SYSIN //LKED.SYSLMOD JOB 31SP,ROSE, CLASS=B EXEC COBUCL DD DSN=TEST.CNTRL DD DSN=TEST.LOAD
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 66 of 72
Effective JCL:
1 //LA$MYJOB JOB 3ISP,ROSE,CLASS=B, 2 //JSTEP1 EXEC COBUCL 3 XXCOBUCL PROC 4 XXCOB EXEC PGM=IKFCBL00 5 XXSYSPRINT DD SYSOUT=* 6 XXSYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) 7 XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) 8 XXSYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) 9 XXSYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) 10 XXSYSLIN DD DSN=**LOADSET, // UNIT=SYSDA,DISP=(MOD,PASS) // SPACE=9TRK,93,300,DCB=BLKSIZE=800 11//COB.SYSIN DD DSN=TESTJCL.CNTL,DISP=SHR . . . 15 //LKED.SYSLMOD DD DSN=TESTJCL.LOAD, // UNIT=SYSDA,DISP=SHR X/SYSLMOD DD DSN=&&GOSET,DISP=(,PASS), // UNIT=SYSDA,SPACE=(CYL,(1,1,1,)0
Page 67 of 72
In the previous example, the notations indicate that COBUCL is a(n) __________ procedure.
Review
Page 68 of 72
Match the job log notation with the JCL statement it describes: 1. XX A. A DD statement in a cataloged procedure that you have overridden B. A DD statement in an in-stream procedure that you have overridden C. A statement in a cataloged procedure that is used
2. X/
3. +/
Review
Page 69 of 72
Glossary
Page 70 of 72
Summary
Page 71 of 72
Summary
Page 72 of 72