0% found this document useful (0 votes)
277 views72 pages

IBM Question Paper-JCL

Uploaded by

shyhacker
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views72 pages

IBM Question Paper-JCL

Uploaded by

shyhacker
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 72

z/OS MVS JCL Advanced

© Copyright IBM Corp., 2000, 2004. All rights reserved.


z/OS MVS JCL Advanced

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

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
z/OS MVS JCL Advanced

Course Objectives (cont’d)

At the end of this course, you will be able to:

• Assign values to symbolic parameters and the DDNAME


operand when executing a procedure

• Identify the purpose of common utility programs

• Code the JCL and utility control statements required to


execute selected utilities

• Using a Utilities Manual, select and execute appropriate


utilities for common processing requirements

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 of 72
z/OS MVS JCL Advanced

UNIT Reviewing Procedures

Topics:
 Using Procedures

 Invoking Procedures

 Invoking Nested Procedures

 Interpreting the Effective JCL

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 6 of 72


z/OS MVS JCL Advanced
Unit: Reviewing 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

At the end of this unit, you will be able to:

• Distinguish between in-stream and cataloged procedures

• Code a statement to invoke a procedure

• Code addition, override, and nullification statements to


modify procedure EXEC and DD statement

• Code a statement to invoke and modify a nested procedure

• Use standard notations to identify procedure statements in


a JCL listing

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 of 72
z/OS MVS JCL Advanced

UNIT Reviewing Procedures

Topics:
 Using Procedures

 Invoking Procedures

 Invoking Nested Procedures

 Interpreting the Effective JCL

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 9 of 72


z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures

Topic Objectives

At the end of this topic, you will be able to:

• Define a procedure

• Explain the importance of using procedures

• Distinguish between in-stream and cataloged


procedures

• Identify in-stream procedures

• Explain the concepts and skills needed to execute


procedures

• Code an effective JCL

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

What are 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.

Why use procedures?

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

Procedures are categorized according to where


they are located. Following are the two types of
procedures:

• In-stream procedure – defined in the job


stream itself. PROC

(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

Identification of In-stream Procedures

You can identify in-stream procedures in the job


stream by: //PROCA PROC
//PSTEP1 EXEC PGM=MYPROG
• The PROC statement, which begins the //DDIN DD DSN=INDATA,
procedure definition // DISP=SHR
//DDOUT DD SYSOUT=A
// PEND
• The PEND statement, which ends the
procedure definition

The example on the right shows an in-stream


procedure named PROCA.

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
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Using Procedures

Are We on Track?

A(n) ______________ procedure is stored as a member of a partitioned data set.

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

Executing a Procedure – An Example

You can execute a procedure with an EXEC


statement that identifies the procedure by name:

//GO EXEC PROCA


or 10
//GO EXEC PROC=PROCA 01
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 CATALOGED


under which the procedure is cataloged in the PROCEDURES
procedure library. An example of executing a 10
cataloged procedure is shown on the right. 01

//GO EXEC PROC A

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

When you execute a procedure, the system


blends the JCL from the procedure definition into
the job stream at the appropriate point. //MYJOB JOB 377-44-1247,D.ROSE
//STEP1 EXEC PGM=PROG1
//DD1 DD DSN=DATA1,DISP=SHR
The combination of the JCL you code and the //DD2 DD SYSOUT=A
JCL in the procedure definition is called the //PSTEP1 EXEC PGM=MYPROG
Effective JCL. //DDIN DD DSN=INDATA,
// DISP=SHR
An example of an effective JCL is shown on the //DDOUT DD SYSOUT=A
right.

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

Effective JCL (cont’d)

//MYJOB JOB 377-44-1247,D.ROSE //MYJOB JOB 377-44-1247,D.ROSE


//PROCA PROC //PROCA PROC
//PSTEP1 EXEC PGM=MYPROG //PSTEP1 EXEC PGM=MYPROG
//DDIN DD DSN=INDATA, //DDIN DD DSN=INDATA,
// DISP=SHR // DISP=SHR
//DDOUT DD SYSOUT=A //DDOUT DD SYSOUT=A
// PEND // PEND
//JSTEP1 EXEC PGM=PROG1 //JSTEP1 EXEC PGM=PROG1
//DD1 DD DSN=DATA1, //DD1 DD DSN=DATA1,
// DISP=SHR // DISP=SHR
//DD2 DD SYSOUT=A //DD2 DD SYSOUT=A
//STEP2 EXEC PROCA //STEP2 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 © 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?

Complete the JCL statement to invoke a procedure named COBUCLG:

//STEP1 EXEC __________________

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?

Match the following terms with their descriptions:

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

3. Procedure step C. A job step within a procedure

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.

PEND statement – A statement that ends a procedure definition.

Procedure step – A job step that is part of a procedure definition.

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

• Explain the importance of using procedures

• Distinguish between in-stream and cataloged


procedures

• Identify in-stream procedures

• Explain the concepts and skills needed to execute


procedures

• Code an effective JCL

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 of 72
z/OS MVS JCL Advanced

UNIT Reviewing Procedures

Topics:
 Using Procedures

 Invoking Procedures

 Invoking Nested Procedures

 Interpreting the Effective JCL

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 23 of 72


z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Topic Objectives

At the end of this topic, you will be able to:

• Obtain and modify a procedure listing

• Explain the rules to code changes to EXEC statement


parameters

• Change DD parameters

• Explain the rules to code changes to DD parameter

• Code the DCB subparameters

• Discuss the rules for sequencing multiple override and


addition DD statements

• Identify the common source for JCL errors

Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Obtaining a Procedure Listing

Before invoking a procedure for a particular job,


you may want to obtain a listing of it to see if it
executes the programs you need, and uses the
appropriate data sets.

How to obtain a procedure listing?


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 10
executes the procedure: 01

//MYJOB JOB 12,D.ROSE,


TYPRUN=SCAN
// TYPRUN=SCAN
//JSTEP EXEC PROCB

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 25 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Modifying Procedure Listing

After analyzing a procedure listing, you may find it


needs some minor alterations to meet your
processing needs.

For example, you may want to change the time


allocated for the procedure to use the CPU, or
change a data set that used in the execution of the
procedure. You can temporarily alter – both
procedure EXEC and DD statement operands

How to modify?

The procedure listing can be modified by coding:


PROCA
TIME=(1,30)
•Addition statement OVERRIDE
•Nullification statement
•Override statement
TIME=(3)
However, changes will apply to only one
invocation of the procedure, without changing
the procedure definition.
Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 26 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Changing EXEC Statement Parameters

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:

• Follow the name of the procedure with a comma.


• Give the name of the EXEC statement parameter to be overridden, nullified or added, followed by
a period.
• Give the name of the procedure step, followed by an equal sign.
• Give the new value for the parameter if you are overriding or adding a value. Do not code a value if
you are nullifying.
• Code changes on the EXEC statement in which you invoke the procedure.

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

Coding Changes to EXEC Statement Parameters

Parameter
to be Procedure New
changed step 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
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Changing EXEC Statement Parameters – An Example

To illustrate an EXEC statement override, review


the procedure definition for TRANSACT, as //PSTEP1 EXEC PGM=PROG1,
shown on the right. // TIME=(1,30)
//DD1 DD DSN=INTRAN,DISP=SHR
//DD2 DD DSN=MASTER,DISP=SHR
The time allocated for TRANSACT is 1 minute 30 //DD3 DD SYSOUT=A
seconds. //DD4 DD DSN=&&VALID,
// DISP=(NEW,PASS),
If the transaction file for the week were much // UNIT=SYSDA,SPACE=(TRK,(1,1))
//PSTEP2 EXEC PGM=PROG2,TIME=5
larger than usual, you might want to change the
//DD5 DD DSN=&&VALID,
time allocated for the procedure to 3 minutes.
// DISP=(OLD,DELETE)
You would code the following override statement
//DD6 DD SYSOUT=A
when executing TRANSACT:

//JSTEP EXEC TRANSACT,


// TIME.PSTEP1=3

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?

A. Override the PGM=parameter on one or more procedure EXEC statements

B. Override operands, such as ACCT, on procedure EXEC statements

C. Nullify data specifications on procedure DD statements

D. Add data specifications on procedure DD statements

E. Permanently alter the JCL in a cataloged procedure

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:

//EXEC TRANSACT, _________________________

Review © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Sequencing Multiple Changes

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?

To sequence multiple changes to EXEC statement parameters:

• 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.

• Separate alterations from each other by a comma.

• Multiple changes must be coded in procedure step 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

Sequencing Multiple Changes – An Example

Assume you need to make the following


alterations to EXEC statement operands in the
TRANSACT procedure:
//JSTEP EXEC TRANSACT,
// TIME.PSTEP 1=3,
• Increase the time restriction for PSTEP1
// PARM.PSTEP1=’01/29/99’,
to 3 minutes
// TIME.PSTEP2=,
• Revert to the installation-defined TIME // PARM.PSTEP2=‘01/29/99’
default for PSTEP2
• Add a PARM parameter value of
01/29/99 for the EXEC statements in
PSTEP1 and PSTEP 2

These modifications are coded on the EXEC


statement that invokes the procedure, as shown
on the right.

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’

C. // EXEC TRANSACT PARM.STEP=,TIME.STEP=

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

Why make the change?

For example, you may want to execute a


procedure such as TRANSACT using a different
storage location for the output data set.

How to make the change?

Code an override DD statement immediately


following the EXEC statement that executes the
procedure. INTRAN

The following override statement executes the


TRANSACT procedure using NEWTRAN rather
than INTRAN:
VOL123435

//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

Rules for Coding Changes to DD Parameter

The rules for coding changes to DD statement parameters are as follows:

• Code a special DD statement immediately following the EXEC statement to invoke the procedure.

• The DD statement has a two-part name:

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.

If you are nullifying a parameter, do not code a value.

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

General Form for DD Changing Parameters

Procedure step in Name of the DD


which the DD statement to be
statement occurs or to overridden or
which a DD statement added
is to be added

// 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 © 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

Why is DDNAME important?


TRANSACT Procedure Definition
The DDNAME on the submitted statement
//PSTEP1 EXEC PGM=PROG1,
determines whether the system treats the
// TIME=(1,30),
statement as an addition or override.
// PARM=‘01/29/99’
//DD1 DD DSN=INTRAN,
If the DDNAME on the submitted statement // DISP=SHR
matches a DDNAME within the procedure, the
parameters on the procedure statement are Override Statement:
overridden, as in the example shown on the right.
If not, the statement is treated as an addition //PSTEP1.DD1 DD DSN=NEWTRAN,
statement. // UNIT=3390,VOL=SER=123435

If a parameter in the procedure DD statement is


matched by one in a submitted DD override
statement, it is overridden. Otherwise it is
retained.

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
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

DCB Subparameters

The data control block (DCB) unlike other


parameters, is not overridden in its entirety, but Original Parameters:
by subparameter. //DD1 DD DSN=MYDSET,DISP=SHR,
// DCB=(BUFNO=1,BLKSIZE=800,
// RECFM=FB,BUFL=800)
DCB subparameters must be nullified explicitly.
You code the DD override statement with the DCB Override Statement:
parameters to be overridden in parentheses. //PSTEP1.DD1 DD DCB=(BLKSIZE=320,
The others are retained, as shown on the right. // BUFL=320)

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?

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 © 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?

Review the JCL below for a procedure named ANYPROC.

//PSTEPA EXEC PGM=PROG1


//DD1 DD DSN=DATFIL,
// DISP=SHR
//DD2 DD SYSOUT=A
//PSTEPB EXEC PGM=PROG2
//DD3 DD SYSOUT=A

1. Code the JCL needed to invoke ANYPROC


//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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 41 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Rules for Coding Multiple Override and Addition DD Statements

When you code multiple addition and override DD statements, you must follow specific sequencing
rules.

• Code override and addition DD statements in procedure step sequence.

• Within a step, specify override DD statements in the same DDNAME sequence as they appear
in the procedure.

• Within a step, code addition DD statements following override DD statements.

Within a procedure step, you must code overrides before additions .

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 42 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Sequencing Multiple Changes – An Example

The example on the right shows the correct way


to sequence the following additions and overrides
//JSTEP EXEC TRANSACT
for TRANSACT:
1.//PSTEP1 DD1 DD DSN=MYDATA
1. An override statement for PSTEP1.DD1 2.//PSTEP1.DD2 DD DSN=CKDATA,
that identifies MYDATA as the input data // DISP=SHR
set 3.//PSTEP2.DD6 DD DSN=INVOICE,
// DISP=(NEW,CATLG),
2. An addition statement for PSTEP1.DD2 // UNIT=3390,
that identifies an input data set named // VOL=SER=692912,
CKDATA (referred to by the DDNAME // SPACE=(TRK,10)
DD2 in PROG1)

3. An override statement for PSTEP2.DD6


that identifies INVOICE as the newly
created output data set

Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 43 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Coding the ddname

Why code the ddname?


//JSTEP EXEC TRANSACT
While coding multiple addition and override
statements for the same procedure step, you can //PSTEP1.DD1 DD DSN=MYDATA
use a shorthand form.
//DD2 DD DSN=CKDATA
How to code the ddname?

Code the ddname for the first override or addition


to each procedure step.

// 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 © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 44 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Procedures

Common Source for JCL Errors

Improperly sequenced addition and override


statements are common source of JCL errors.

MASTER
JCL error – An example

If an addition statement is coded before an


override statement for the same procedure step,
the system will interpret the override statement as
another addition. WRONG
10 DATA
01
The procedure may execute, but with the wrong
data as illustrated on the right. 10
01

RIGHT
DATA

INCORRECT OUTPUT INTENDED OVERRIDE

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?

Review the following DD statements from STEPC of a sample procedure:


. . .
//DD4 DD DSN=A.B.C…
//DD5 DD DSN=STRP …
//DD6 DD DSN=TYPE3,..
//DD7 DD DSN=A.B.D…

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.)

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 © 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.

TYPRUN=SCAN – A JOB statement parameter that suppresses execution of the job. It


is often used for checking JCL syntax errors.

Operands – Keyword or positional statements in the operand field of a JCL


statement.

Data Control Block – A parameter on a DD statement that describes the attributes of a


data set, such as block size and record format.

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:

• Obtain and modify a procedure listing

• Explain the rules to code changes to EXEC statement


parameters

• Change DD parameters

• Explain the rules to code changes to DD parameter

• Code the DCB subparameters

• Discuss the rules for sequencing multiple override and


addition DD statements

• Identify the common source for JCL errors

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 49 of 72
z/OS MVS JCL Advanced

UNIT Reviewing Procedures

Topics:
 Using Procedures

 Invoking Procedures

 Invoking Nested Procedures

 Interpreting the Effective JCL

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 50 of 72


z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Invoking Nested Procedures

Topic Objectives

At the end of this topic, you will be able to:

• Define nested procedure

• Code overrides and additions

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

What is a nested procedure? PROCA

When procedures are nested, one procedure //PSTEP EXEC PGM=ABC


invokes another.

//PSTEP EXEC PROCB


Nested procedure – An example
PROCB

There are three procedures:


//STEP1 EXEC PROCC
PROCA
PROCB //STEP2 EXEC PGM=XYZ
PROCC
PROCC

In the example on the right, there are three


procedures, PROCA, PROCB, and PROCC. //S1 EXEC PGM=KLM
PROCA invokes PROCB, and PROCB invokes
PROCC. //S2 EXEC PGM=RST

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

Coding Overrides and Additions

Procedures can be nested up to 15 levels. PROCA


//PSTEP EXEC PGM=ABC
Changes to nested procedures can be complex,
since you can only override a procedure at the //PSTEP EXEC PROCB
point where it is called. In the example on the
right, PROCA is overridden. OVERRIDE
PROCB

//STEP1 EXEC PROCC

//STEP2 EXEC PGM=XYZ


PROCC

//S1 EXEC PGM=KLM

//S2 EXEC PGM=RST

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

Coding Overrides and Additions – An Example

Assume PROCA and PROCB have the JCL


shown. Note that PROCA invokes PROCB.
PROC A:
//PROCA PROC
You want to add an addition statement with a //PROCA1 EXEC PGM=ONE
DDNAME of DD2 to both procedures. //OUT DD
SYSOUT=&OUTCLASS
//PROCA2 EXEC PROCB

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

Coding Overrides and Additions – An Example (cont’d)

To include an addition statement while invoking


PROCB, PROCA needs to be modified:
//STEP1 EXEC PROCA
//PROCA1.DD2 DD DSN=NEWDS,
//PROCA PROC // DISP=SHR
//PROCA1 EXEC PGM=ONE //PROCB1.DD2 DD DSN=NEWDS,
// DISP=SHR
//OUT DD SYSOUT=&OUTCLASS
//PROCA2 EXEC PROCB

Then execute PROCA with the addition for


PROCA, as shown on the right.

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:

//JSTEP EXEC PROC3,TIME=3

What is the effect of this override statement?

A. The specified TIME parameter applies to PROC1 through PROC3

B. The specified TIME parameter applies to PROC3 through PROC12

C. The specified TIME parameter applies to all procedures

D. The specified TIME parameter applies to PROC3

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:

• Define nested procedure

• Code overrides and additions

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 57 of 72
z/OS MVS JCL Advanced

UNIT Reviewing Procedures

Topics:
 Using Procedures

 Invoking Procedures

 Invoking Nested Procedures

 Interpreting the Effective JCL

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 58 of 72


z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL

Topic Objectives

At the end of this topic, you will be able to:

• Define effective JCL

• Explain the importance of JCL

• Obtain a JCL listing

• Distinguish the different categories of JCL statements

• Analyze the JCL listing

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

Effective JCL Listing

What is 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

Obtaining a JCL Listing

How to obtain a JCL listing?

If your system does not include a JCL listing by


default, you request it by coding a value of 1 as
the first MSGLEVEL subparameter of the job
statement: JOB

//MYJOB JOB 12,D.ROSE,


// MSGLEVEL=1
TRANSACT

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.

//LA$TEST2 JOB 32-44,D.ROSE,___________

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

Notation in columns 1, Statement identified


2 and 3
Cataloged In-stream
procedure procedure

// // 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 that is used during a job execution

X/ +/ A DD statement in a procedure definition that you have overridden

XX* ++ A statement in a procedure definition, other than a comment statement, that the
system considers to be a comment

*** *** A comment or job entry subsystem control statement

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

Analyzing the 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

Analyzing the JCL – An Example

1 //LA$TEST2 JOB (31SPC090156W),ROSE,CLASS=B


2 //JOBLIB DD DSN=TSOCHIS.TESTJCL.LOAD, DISP=SHR
//TRANSACT PROC
//PSTEP1 EXEC PGM=PROG1
//DD1 DD DSN=TSOCHIS.INTRAN,DISP=SHR
//DD2 DD DSN=TSOCHIS.MASTER,DISP=SHR
//DD3 DD SYSOUT=A
//DD4 DD DSN=&&VALID,UNIT=SYSDA, DISP=(NEW,PASS),SPACE=(TRK,(1,1))
//PSTEP2 EXEC PGM=PROG2
//DD5 DD DSN=&&VALID,DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
// PEND
3 //JSTEP EXEC TRANSACT
4 ++TRANSACT PROC
5 ++//PSTEP1 EXEC PGM=PROG1
6 ++//DD1 DD DSN=TSOCHIS INTRAN,DISP=SHR
7 ++//DD2 DD DSN=TSOCHIS.MASTER,DISP=SHR
8 ++//DD3 DD SYSOUT=A
9 ++//DD4 DD DSN=&&VALID,UNIT=SYSDA,DISP=(NEW,PASS),SPACE=(TRK,(1,1))
10 ++//PSTEP2 EXEC PGM=PROG2
11 ++//DD5 DD DSN=&&VALID,DISP=(OLD,DELETE)
12 ++//DD6 DD SYSOUT=A

An example of effective JCL is shown above.


Concepts © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 65 of 72
z/OS MVS JCL Advanced
Unit: Reviewing Procedures Topic: Interpreting the Effective JCL

Analyzing the JCL Listing

The example on the right shows the JCL listing


for
JCL Submitted:
a job that executes a procedure named COBUCL.
//LA$MYJOB JOB 31SP,ROSE,
In the submitted JCL, notice the addition // CLASS=B
statement for procedure step COB and the //JSTEP1 EXEC COBUCL
override statement for procedure step LKED. //COB.SYSIN DD
DSN=TEST.CNTRL
//LKED.SYSLMOD DD DSN=TEST.LOAD

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

Analyzing the JCL Listing (cont’d)

The example on the right shows the JCL listing


for Effective JCL:
a job that executes a procedure named COBUCL.
1 //LA$MYJOB JOB 3ISP,ROSE,CLASS=B,
2 //JSTEP1 EXEC COBUCL
In the effective JCL, the addition statement is 11, 3 XXCOBUCL PROC
and the override statement is number 15. 4 XXCOB EXEC PGM=IKFCBL00
5 XXSYSPRINT DD SYSOUT=*
The numbers indicate the actual sequence in 6 XXSYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
7 XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
which the system executes these statements.
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
The notation (X/) marks the statement that was
overridden.

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:

1. XX A. A DD statement in a cataloged procedure that you have


overridden

2. X/ B. A DD statement in an in-stream procedure that you have


overridden

3. +/ C. A statement in a cataloged procedure that is used

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

MSGLEVEL – A JOB statement parameter that controls the printing of JCL


statements and allocation messages.

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:

• Define effective JCL

• Explain the importance of JCL

• Obtain a JCL listing

• Distinguish the different categories of JCL statements

• Analyze the JCL listing

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:

• Distinguish between in-stream and cataloged


procedures

• Code a statement to invoke a procedure

• Code addition, override, and nullification statements

• Modify procedure EXEC and DD statement

• Code a statement to invoke and modify a nested


procedure

• Use standard notations to identify procedure statements


in a JCL listing

Summary © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 72 of 72

You might also like