IBM Question Paper-JCL
IBM Question Paper-JCL
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 2 of 72
z/OS MVS JCL Advanced
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 3 of 72
z/OS MVS JCL Advanced
Course Objectives
Continued…
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 4 of 72
z/OS MVS JCL Advanced
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 of 72
z/OS MVS JCL Advanced
Topics:
Using Procedures
Invoking Procedures
Unit Introduction
Most installations have pre-coded procedures that can help you perform frequent jobs, more easily.
This unit reviews and summarizes the concepts and skills needed to execute and modify procedures. The
unit will focus on the JCL programmer as a procedure user, rather than as a procedure creator.
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 7 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures
Unit Objectives
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 of 72
z/OS MVS JCL Advanced
Topics:
Using Procedures
Invoking Procedures
Topic Objectives
• Define a procedure
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 10 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Using Procedures
Procedures are pre-coded sets of Job Code Language (JCL) statements with a unique name. For a
procedure to perform its function the procedure in a job stream must be placed at the appropriate
location.
If you perform a task regularly and the JCL used is lengthy or complex, it is to your advantage to use a
procedure.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 11 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Types of Procedures
(In-stream)
• Cataloged procedure – stored as a
member of a partitioned data set.
PEND
(Cataloged)
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 12 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 13 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Are We on Track?
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 14 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Are We on Track?
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 15 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 16 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Effective JCL
Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 17 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 18 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Are We on Track?
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 19 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Are We on Track?
1. Procedure definition A. The JCL in a procedure definition combined with the JCL
you code
2. Effective JCL B. Pre-coded JCL with a unique name, which consists of one
or more job steps
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 20 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Glossary
Procedures – Pre-coded sets of JCL with a unique name.
Partitioned data set – 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.
PROC statement – A statement that begins a procedure definition and isolates it from
the other JCL in a job stream.
Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 21 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures
Topic Summary
Now that you have completed this topic, you should be able to:
• Define a procedure
Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 of 72
z/OS MVS JCL Advanced
Topics:
Using Procedures
Invoking Procedures
Topic Objectives
• Change DD parameters
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 25 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
How to modify?
You can override, nullify, or add EXEC statement parameters such as PARM or TIME on the EXEC
statement to invoke the procedure.
Following are the rules for coding changes to EXEC statement parameters:
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 27 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Parameter
to be Procedure New
changed step 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
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 29 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
Which of the following actions can you perform when a procedure is invoked for use?
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 30 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
Complete the following JCL statement to invoke the procedure TRANSACT and pass a PARM
value of '9/10/98' to PROG1 in PSTEP1:
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Many changes can be made to EXEC statement parameters for one or more procedure steps by combining
them on the EXEC statement you use to invoke the procedure.
What are the sequence rules for coding multiple EXEC statement changes?
• Specify alterations in procedure step sequence. The alterations for one step must be specified
before the alterations for a subsequent step.
• Within any one step, you can specify alterations in any sequence.
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
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 33 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
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’
D. // EXEC TRANSACT,TIME.PSTEP1=2,PARM.PSTEP1=‘12/1/99’,TIME.PSTEP2=
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 34 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Changing DD Parameters
//PSTEP1.DD DD DSN=NEWTRAN,
// UNIT=3390,
// VOL=SER=123435 NEWTRAN
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 35 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
• Code a special DD statement immediately following the EXEC statement to invoke the procedure.
o 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.
o 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.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
// PROCSTEPNAME.DDNAME DD PARAMETER=VALUE
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 37 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Significance of DDNAME
DCB Subparameters
Resulting Parameters:
Similarly DCB subparameters must be nullified
//DD1 DD DSN…
explicitly. Those that are not nullified are
// DCB=(BUFNO=1,BLKSIZE=320,
retained. To nullify the entire DCB parameter,
// RECFM=FB,BUFL=320)
you must explicitly nullify each subparameter as
shown below:
// DCB=(BUFNO=,BLKSIZE=,
// RECFM=,BUFL=)
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 39 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 40 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
2. Specify, for PROG2, a data set named INDATA. (PROG2 refers to the data set by the DDNAME
TEST.)
//PSTEPB.TEST DD _________
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 41 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
When you code multiple addition and override DD statements, you must follow specific sequencing
rules.
• Within a step, specify override DD statements in the same DDNAME sequence as they appear
in the procedure.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 42 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 43 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
// ddname DD …
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 44 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
MASTER
JCL error – An example
RIGHT
DATA
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 45 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 46 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Are We on Track?
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.)
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 47 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Glossary
IEBGENER Utility – A data set utility program that is designed to copy records from a
sequential data set.
IEBPTPCH Utility – A standard IBM utility program that is designed to print or punch
data sets.
Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 48 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures
Topic Summary
Now that you have completed this topic, you should be able to:
• Change DD parameters
Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 49 of 72
z/OS MVS JCL Advanced
Topics:
Using Procedures
Invoking Procedures
Topic Objectives
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 51 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
Nested Procedure
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 52 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 53 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
PROC B:
//PROCB PROC
// SET OUTCLASS=B
//PROCB1 EXEC PGM=TWO
//OUT DD
SYSOUT=&OUTCLASS
Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 54 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 55 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
Are We on Track?
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 56 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures
Topic Summary
Now that you have completed this topic, you should be able to:
Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 57 of 72
z/OS MVS JCL Advanced
Topics:
Using Procedures
Invoking Procedures
Topic Objectives
Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 59 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
When invoking a procedure, the system executes both the JCL that you submit and the JCL that is
stored within a procedure. This is called the effective JCL.
Why is it important?
Requesting a listing of effective JCL in your job output can be helpful in tracking the source of errors, or
determining if the effective JCL is what you need.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 60 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
10
01
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 61 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Are We on Track?
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 62 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
JCL Listing
// // Statements you submit with the job, including in-stream procedures definition (if
applicable) and any later alteration DD statements
XX* ++ A statement in a procedure definition, other than a comment statement, that the
system considers to be a comment
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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 63 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
The example on the next slide shows the JCL listing from a job called LA$TEST2, which invokes the
TRANSACT procedure.
In the JCL listing, the statement numbers identify the actual sequence in which the JCL is executed.
Special notations distinguish the JCL statements submitted with the job (//) and those that are used (++).
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 64 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Continued…
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 66 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 67 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Are We on Track?
In the previous example, the notations indicate that COBUCL is a(n) __________
procedure.
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 68 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Are We on Track?
Match the job log notation with the JCL statement it describes:
Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 69 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Glossary
Glossary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 70 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL
Topic Summary
Now that you have completed this topic, you should be able to:
Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 71 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures
Unit Summary
Now that you have completed this unit, you should be able to:
Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 72 of 72