Upload
carlos-alberto-chong-antonio
View
246
Download
1
Embed Size (px)
Citation preview
7/30/2019 jcl nivel avanzado unidad 2
1/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved.
7/30/2019 jcl nivel avanzado unidad 2
2/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 2 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
7/30/2019 jcl nivel avanzado unidad 2
3/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 3 of 90
As a JCL programmer, your ability to use procedures enables you to make more effective use of thesystem.
Your ability to create procedures will enable you to help others make better use of the system.
In this unit, you will learn how to build procedures that can be executed easily and used in a variety of
situations.
Unit Introduction
Introduction
Unit: Creating Effective Procedures
7/30/2019 jcl nivel avanzado unidad 2
4/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 4 of 90
At the end of this unit, you will be able to:
Code statements that are required in a proceduredefinition
Identify statements that are not allowed in a procedure
definition
Specify the criteria for creating a useful procedure
Code the DDNAME operand on one or more DDstatements in a procedure definition
Unit Objectives
Introduction
Unit: Creating Effective Procedures
Continued
7/30/2019 jcl nivel avanzado unidad 2
5/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 of 90
At the end of this unit, you will be able to:
Specify DD statements to resolve the DD operand
Code symbolic parameters on the EXEC and DDstatements of a procedure
Assign user values to symbolic parameters
Specify default values for symbolic parameters on thePROC statement of a procedure
Nullify and override symbolic parameter default values
Unit Objectives (contd)
Introduction
Unit: Creating Effective Procedures
7/30/2019 jcl nivel avanzado unidad 2
6/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 6 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
7/30/2019 jcl nivel avanzado unidad 2
7/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 7 of 90
At the end of this topic, you will be able to:
Create and design procedures
Identify the general form and rules to assignsymbolic parameters
Identify the general form and rules to code a PENDstatement
Identify the general form and rules to codeprocedure steps
General form and rules - dos and donts
Design a basic procedure
Topic Objectives
Introduction
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
8/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 of 90
Why create a procedure?
The primary reason for creating a procedure is to
simplify the task of coding the JCL for a job that is
executed frequently.
The basic objective when creating a procedure isto minimize the execution-time alterations theprocedure user has to specify.
If the basic JCL is already pre-coded as aprocedure, you need to code only a few, simpleJCL statements to submit the job.
Designing Procedures
PROC A
JOB
ContinuedConcepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
9/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 9 of 90
How to code the procedure?
To code a procedure you should:
1. Execute the proper programs in therequired sequence
2. Identify the data sets required by eachprogram
3. Specify those program and data setparameters required for typical jobexecution environment
Designing Procedures (contd)
EXEC PGM=
DD DSN=
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
10/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 10 of 90
Which of the following are characteristics of an effective procedure?
A. It executes the required programs in the needed order.
B. It contains few DD specification, enabling the user to add these later.
C. It specifies the data sets required for each program.
D. It requires a minimum of runtime adaptations.
Are We on Track?
Review
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
11/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 11 of 90
When building an in-stream procedure, identify
the name of the procedure to be invoked
on the PROC statement.
//PROCA PROC
If you are inserting more than one in-streamprocedure in a job, begin each one with a PROCstatement that assigns a unique name to theprocedure, as shown in the example on the right.
General Form and Rules
The procedure name can be one to eightalphanumeric or national symbols. The first
character must be alphabetic or national.
//JOBNAME JOB
//PROCA PROC
...
// PEND
//PROCB PROC
...// PEND
//JSTEP1 EXEC PROCA
//JSTEP2 EXEC PROCB
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
12/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 12 of 90
How to assign symbolic parameters?
Begin a cataloged procedure with a PROC
statement only when assigning a symbolicparameter. The form to assign a symbolicparameter is as follows:
//Procname PROC Symbolic Parameters
When you add a new procedure to a procedurelibrary, the member name becomes the name bywhich the procedure is invoked.
General Form and Rules Symbolic Parameters
PROCEDURELIBRARY
JOB
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
Do not begin a cataloged procedure with aPROC statement unless you are assigning
symbolic parameters.
7/30/2019 jcl nivel avanzado unidad 2
13/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 13 of 90
The PEND statement immediately follows an in-stream procedure definition. The PEND statementcan be used with or without a name.
// PEND
or
//ENDPROC PEND
If you do not include a name on the PENDstatement, at least one blank must separate theword PEND from the slashes in columns 1 and 2
of the statement, as shown on the right.
General Form and Rules PEND Statement
//JOBNAME JOB
//PROCA PROC
---------
---------
//ENDPROCA PEND
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
14/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 14 of 90
Following the PROC statement are the proceduresteps that constitute the procedure definition.
You can include an in-stream procedure definitionanywhere within a job stream following the JOBstatement, but it must precede the EXECstatement that invokes the procedure, as shown
on the right.
Procedure steps for both in-stream and cataloged
procedures consist of the following:
An EXEC statement that identifies a
program to be executed
The DD statements required to definethe data sets to be used or created bythe program
General Form and Rules Procedure Steps
//JOBNAME JOB...
//PROCA PROC...
//PSTEP1 EXEC...
//DD1...
//DD2...
//PSTEP2 EXEC....
.
.
// PEND
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
15/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 15 of 90
A procedure can contain the following:
Symbolic parameters on the EXEC andDD statement.
Comment statement (//*) in a proceduredefinition at any appropriate place to aidin documenting the procedure.
The screen on the right illustrates examples ofthese statements.
General Form and RulesDos
//JOBNAME JOB...
//PROCA PROC...
//PSTEP1 EXEC PGM=&SYMB1
//DD1 DD DSN=&SYMB2
//DD2...
//PSTEP2 EXEC...
//*Comment
.
.
.
// PEND
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
16/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 16 of 90
A procedure cannot contain the following:
JOB, delimiter {/*}, or null {//}statements
DD statements with the *or DATAparameters
Any data records
Special job entry subsystem {JES2 orJES3} control statements
DD statements with the name JOBLIBor JOBCAT
The screen on the right shows examples of these
statements that should not be in a proceduredefinition.
General Form and RulesDonts
//JSTEP1 JOB
/*
//
//DD1 DD DATA
0001 8765 3864
/*JOBPARM COPIES=5
//JOBLIB DD DSN=MYLIB,DISP=SHR
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
17/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 17 of 90
Which of the following statements could be included in a procedure definition?
A. //MYJOB JOB 377,DEPT50
B. //STEP1 EXEC PGM=A
C. //DD2 DD DATA
D. /*
E. //DD3 DD DSN=MYDATA,DISP=SH
F. //DD4 DD SYSOUT=A
G. //
Are We on Track?
Review
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
18/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 18 of 90
The screen on the right illustrates the examplewhere each week, a department produces a
transaction file named INTRAN that contains new
customer orders for the week.
A list of orders to be filled is sent to the
warehouse and an invoice is sent to eachcustomer.
The order list and associated invoice are printed
once a week.
Design a Basic Procedure An Example
JOB
ORDERS
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
Continued
7/30/2019 jcl nivel avanzado unidad 2
19/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 19 of 90
You are asked to create a procedure named TRANSACT to accomplish the following task:
Invoke a program named PROG1 This checks input transactions against a master customer listto determine if each transaction applies to a valid customer. PROG1 then writes any rejectedtransactions to a transaction exception report. It writes all valid transactions to a temporary dataset that is passed to PROG2.
Invoke a program named PROG2 This processes the valid transactions passed to it fromPROG1 and creates an order list/invoice for each customer.
Design a Basic ProcedureAn Example (contd)
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
20/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 20 of 90
PROG1 uses the following data sets:
The input transactions are in a catalogeddata set named INTRAN. PROG1 usesthe DDNAME DD1.
The master customer list is in acataloged data set named MASTER.
PROG1 uses the DDNAME DD2.
The transaction exception report is to becreated as SYSOUT class A output{DDNAME DD3}.
Valid transactions go to a temporarydata set to be passed to PROG2{DDNAME DD4}. The temporary data
set should be named &&VALID andspace allocated for it on a SYSDA unit.Use single-track primary and secondaryspace allocation.
Design a Basic Procedure PROG1 Data Sets
Input Transactions
Master Customer List
Temporary Data Set
INTRAN
&&VALID
MASTER
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
21/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 21 of 90
PROG2 uses the following data sets:
The valid transactions passed fromPROG1 are in a temporary data setnamed &&VALID. PROG2 uses theDDNAME DD5.
The order list/invoice for each customeris created as SYSOUT class A output.PROG2 uses the DDNAME DD6.
Design a Basic Procedure PROG2 Data Sets
&&VALID
SYSOUT CLASS A
Temporary Data Set
Concepts
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
22/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 of 90
In coding the JCL for the previous TRANSACT procedure, how many DD statementswould you require?
A. Two
B. Four
C. Five
D. Six
Are We on Track?
Review
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
23/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 23 of 90
Match the name of data sets required for TRANSACT with the data set description:
1. INTRAN A. A temporary data set that is output for PROG1 and input forPROG2
2. MASTER B. A cataloged data set with the master customer list
3. &&VALID C. Printed output of the customer order list and invoices
4. SYSOUT D. A cataloged data set with weekly transactions
Are We on Track?
Review
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
24/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 of 90
Complete the JCL statements to fulfill the requirements of the sample application, as follows:
1. //PSTEP1 EXEC PGM=PROG1
2. //DD1 DD __________ DISP=SHR
3. //DD2 DD __________ DISP=SHR
4. //DD3 DD SYSOUT=A5. //DD4 DD ______DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
6. //PSTEP2 EXEC __________
7. //DD5 DD DSN=&&VALID,DISP=(OLD,DELETE)
8. //DD6 DD SYSOUT=A
In step 2, identify the input data set named DD1, used by PROG1
In step 3, identify the input data set named DD2, used by PROG1
In step 5, identify the temporary data set named DD4
In step 6, identify the program executed in PSTEP2
Are We on Track?
Review
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
25/90
7/30/2019 jcl nivel avanzado unidad 2
26/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 26 of 90
JOBCAT A JCL statement that is placed after the JOB statement when creatingVSAM data sets.
Cataloged Data Set A non-temporary data set for which the system has recorded the unitand volume on which the data set resides.
SYSOUT A keyword that defines a print data set. It instructs the system to queuethe output on direct-access volume.
Temporary Data Set A data set that stores data needed only for the duration of the job.
Secondary Space Allocation The number of units (blocks, tracks, or cylinders) allocated to a data setif the primary allocation is exceeded.
Glossary (contd)
Glossary
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
27/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 27 of 90
Now that you have completed this topic, you should be able to:
Create and design procedures
Identify the general form and rules to assign symbolicparameters
Identify the general form and rules to code a PENDstatement
Identify the general form and rules to code proceduresteps
General form and rules - dos and donts
Design a basic procedure
Topic Summary
Summary
Unit: Creating Effective Procedures Topic: Designing Procedures
7/30/2019 jcl nivel avanzado unidad 2
28/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 28 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
7/30/2019 jcl nivel avanzado unidad 2
29/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 29 of 90
At the end of this topic, you will be able to:
Code a DDNAME parameter
Resolve a DDNAME operand
Topic Objectives
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Introduction
7/30/2019 jcl nivel avanzado unidad 2
30/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 30 of 90
The TRANSACT procedure, on the right, meetstwo of the guidelines:
It performs the exact functions requiredby the sample application.
It does not require the procedure user tospecify any execution-time alterationsfor typical procedure use.
But does it simplify as much as possible the JCLthat the user has to code at procedure execution?
TRANSACT Procedure
//PSTEP1 EXEC PGM=PROG1
//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
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Concepts
7/30/2019 jcl nivel avanzado unidad 2
31/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 of 90
If the attributes of the data sets identified inTRANSACT vary from one instance of theprocedures use to the next, the user will need to
code DD override and addition statements at thetime of executing the procedure.
However, generalizing the TRANSACT procedure
to process data input from a variety of sources,you will avoid the need for overrides andadditions. One way of accomplishing this is theDDNAME parameter.
DDNAME Parameters
IN-STREAMINPUT
DASD
TAPE VOLUME
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Concepts
7/30/2019 jcl nivel avanzado unidad 2
32/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 32 of 90
You should code a DDNAME on the appropriate procedure step, generally to represent an input data set. This
postpones definition of the data set attributes until the procedure is invoked.
The DDNAME parameter consists only of the operand name {DDNAME} followed by an equal sign and a
Value (VALUE, in this example).
Coding a DDNAME
Parameter field
// STEP1 DD DDNAME=VALUE
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Concepts
7/30/2019 jcl nivel avanzado unidad 2
33/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 33 of 90
The example on the right illustrates theTRANSACT procedure definition with a DDNAMEparameter for the input data set.
Note that the value of the DDNAME parameter isnot the same as the ddname of the statement(DD1 in this example).
Coding a DDNAME An Example
The value of the DDNAME parameter is not thesame as the ddname of the statement.
//PSTEP1 EXEC PGM=PROG1
//DD1 DD DDNAME=INPUT
//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
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Concepts
/OS MVS JCL Ad d
7/30/2019 jcl nivel avanzado unidad 2
34/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 34 of 90
When invoking the procedure, you code a DDstatement to identify the attributes of the data set
represented by DDNAME=INPUT. Coding a DDstatement to identify the attributes of the data setis called resolving the DDNAME operand.
The DD statement has a two-part name:
The name of the procedure step inwhich the DD statement containing theDDNAME parameter is used, followedby a period
The value as specified in the DDNAMEoperand
In the example on the right, DDNAME is resolvedwith the data set name MYDATA, with the unitand volume specifications shown.
Resolving the DDNAME Operand
//STEP EXEC TRANSACT
//PSTEP1.INPUT DD DSN=MYDATA,
// UNIT=3390,
// VOL=SER456789
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Concepts
/OS MVS JCL Ad d
7/30/2019 jcl nivel avanzado unidad 2
35/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 35 of 90
Which of the following is an advantage of using the DDNAME parameter in a procedure?
A. You can postpone specifying data set attributes until procedures execution.
B. You enable the user to execute the procedure using different programs.
C. You can relieve the procedure user of the need to specify data set attributes.
Are We on Track?
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Review
/OS MVS JCL Ad d
7/30/2019 jcl nivel avanzado unidad 2
36/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 of 90
Code a DDNAME parameter to define the temporary data set PROG1 that refers to the DDNAMEDD4. Define the actual data set characteristics using the name TSTDATA.
TRANSACT Procedure:
//PSTEP1 EXEC PGM=PROG1
//DD1 DD
//DD2 DD DSN=MASTER, DISP=SHR
//DD3 DD SYSOUT=A
//DD4 DD ____________
Are We on Track?
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Review
/OS MVS JCL Ad d
7/30/2019 jcl nivel avanzado unidad 2
37/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 37 of 90
Complete the statement required at procedure invocation time to resolve DDNAME as anexisting data set named MYDATA.
JCL to invoke TRANSACT:
//SS1 EXEC TRANSACT
//PSTEP1.TSTDATA DD DSN=MYDATA,DISP_______ _______
Are We on Track?
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Review
/OS MVS JCL Ad d
7/30/2019 jcl nivel avanzado unidad 2
38/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 38 of 90
DDNAME Parameter A parameter coded in a procedure definition that represents an actualdata set and its attributes.
Glossary
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Glossary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
39/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 39 of 90
Now that you have completed this topic, you should be able to:
Code DDNAME parameter
Resolve DDNAME operand
Topic Summary
Unit: Creating Effective Procedures Topic: Using the DDNAME Parameter
Summary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
40/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 40 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
41/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 41 of 90
At the end of this topic, you will be able to:
Define symbolic parameters
Explain the standards/rules for forming symbolicparameters names
Assign values to symbolic parameters
Nullify symbolic parameters
Specify symbolic parameters
Topic Objectives
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
42/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 42 of 90
What are symbolic parameters?
Symbolic parameters are a technique to build
flexibility into procedures. A symbolic parameter
represents a procedure statement parameter or
subparameter.
The procedure statement operands whose valuesare most likely to change from one procedureinvocation to another, are suitable candidates tobe coded as symbolic parameters. The exampleon the right illustrates such a procedure statementoperand, ACCT.
Symbolic Parameters
DEPT10
DEPT20
DEPT30
DEPT40
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
43/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 43 of 90
How do symbolic parameters help?
Coding symbolic parameters simplifies the procedure users task in a number of ways:
The user can assign the appropriate value when the procedure is invoked.
The user can simply accept a default value if one is assigned.
The user can assign a value to the symbolic parameter only once to change all recurring likeoperands in statements occurring through the entire procedure. This is useful if the samevalue is to be used for like operands in statements occurring throughout the procedure.
Significance of Symbolic Parameters
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
44/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 44 of 90
Standards for Symbolic Parameter Names
A name for a symbolic parameter can be specified. Many data processing installations have standards forsymbolic parameter names to ensure consistency across frequently used procedures.
Rules for coding symbolic parameter names in a procedure definition are as follows:
Should be preceded by an ampersand (&).
Should consist of from one to seven alphanumeric {A to Z} or national {#@$) symbols.
It cannot conflict with an EXEC statement keyword. That is, keywords such as PGM, COND, andPARM cannot be used.
It cannot conflict with the name of another symbolic parameter in the same procedure. If more than
one value is assigned to a symbolic parameter, only the first can be used.
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
45/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 45 of 90
Which of the following are advantages of symbolic parameters?
A. They enable the user to simply accept default values, if appropriate.
B. They can be given a name that is meaningful, such as &DEPT.
C. They enable the user to assign values when the procedure is executed.
D. They can be assigned different values within a job.
E. They can represent a data set and all its attributes.
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
46/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 46 of 90
Which are the symbolic parameters in the following JCL from a procedure named ANYPROC?
//S2 EXEC PGM=&A,ACCT=&GRP
//DD5 DD DSN=&&SYM,DISP={OLD,DELETE}
//DD6 DD SYSOUT=A
A.PGM=&A,ACCT=&GRP,DSN=&&SYM
B. DSN=&&SYM,ACCT=&GRP
C. PGM=&A,ACCT=&GRP
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
47/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 47 of 90
To illustrate the usefulness of symbolicparameters in a procedure definition, theTRANSACT example has been modified.
Assume that several different departments in thecompany use the TRANSACT procedure. Eachdepartment is required to provide the department
number, for accounting purposes, when theprocedure is used.
You can accommodate this varying execution-time requirement by specifying a symbolicparameter to represent the ACCT parametervalue in the EXEC statements of the procedure,
as shown on the right.
ACCT=&DEPT
Symbolic Parameters for EXEC Statement Parameters
//PSTEP1 EXEC PGM=PROG1,
// ACCT=&DEPT
//DD1 DD DSN=INTRAN,DISP=SHR
//DD2 DD DSN=MAASTER,DISP=SHR
//DD3 DD SYSOUT=A
//DD4 DD DSN=&&VALID,
// DISP=(NEW,PASS),//PSTEP2 EXEC PGM=PROG2,ACCT&DEPT
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
48/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 48 of 90
The procedure user can then assign a value to ornullify the symbolic parameter on the EXECstatement, used to invoke the procedure.
How to assign a value to a symbolic
parameter?
The user should specify the symbolic parameterwithout the preceding ampersand, followed by anequal sign and the value.
How to nullify a symbolic parameter?
The user should specify the symbolic parameterwithout the preceding ampersand, followed byonly an equal sign.
Assign or Nullify Symbolic Parameters
To assign a value to a symbolicparameter:
//JSTEP EXEC TRANSACT,DEPT=GRP50
To nullify the symbolic parameter:
//JSTEP EXEC TRANSACT,DEPT=
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
49/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 49 of 90
Symbolic parameters are particularly useful inenabling a procedure to be executed with different
programs.
The PGM operand cannot be overridden when aprocedure is executed. So you have to specify asymbolic parameter for the PGM in the procedure
definition, as shown in the TRANSACT proceduredefinition on the right.
Specifying a Symbolic Parameter for PGM
//PSTEP1 EXEC PGM=&PROG1
//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
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
Continued
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
50/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 50 of 90
After specifying symbolic parameter for PGM in theprocedure definition, you can assign the appropriatevalue (or values) to the symbolic parameter wheninvoking the procedure, as shown in the Statementto invoke TRANSACT on the right.
Specifying a Symbolic Parameter for PGM (contd)
//JSTEP EXEC TRANSACT,PROG1=TEST1,
// PROG2=TEST2
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
51/90
z/OS MVS JCL Advanced
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 51 of 90
Complete the S1 EXEC statement for a procedure named ANYPROC with the following symbolicparameters.
Code a symbolic parameter for PGM and name it &PROG
//S1 EXEC PGM=_________
Code a symbolic parameter for ACCT and name it &DEPT
// ACCT=________
//DD1 DD DSN=&INPUT,DISP=SHR
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
52/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 52 of 90
Complete the JCL statement required to invoke procedure ANYPROC from the previousexercise, and specify the following:
1. Nullify the &DEPT symbol.
2. Assign a value of MYPROG to &PROG.
//JSTEP EXEC ANYPROC,_____________________
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
53/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 53 of 90
When executing a procedure with symbolicparameters, you cannot assign different values tosame symbolic parameter within one job.
However, if you anticipate the need to assigndifferent values, you can define a differentsymbolic parameter to represent each occurrence
of the operand.
For example, when different departments want toexecute TRANSACT in the same job you candefine a different symbolic parameter for eachoccurrence of the ACCT operand, as shown onthe right.
Assigning Values
TRANSACT definition:
//PSTEP1 EXEC PGM=PROG1,
// ACCT=&DEPT1
//PSTEP2 EXEC PGM=PROG2,
// ACCT=&DEPT2
Assigning values to &DEPT:
//JSTEP EXEC TRANSACT,
// DEPT1=GRP50,
// DEPT2=GRP100
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
54/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 54 of 90
With Release 4 of MVS/ESA and later, a SETstatement can also be used to assign values tosymbolic parameters.
How to code a SET statement?
Rather than assigning values on the EXEC
statement used to invoke the procedure, you codea SET statement as follows:
// SET parameter=value,
// parameter=value
The example on the right shows how to assignvalues to &DEPT using a SET statement.
Assigning Values Using SET Statement
TRANSACT definition:
//PSTEP1 EXEC PGM=PROG1,
// ACCT=&DEPT1
//PSTEP2 EXEC PGM=PROG2,
// ACCT=&DEPT2
Assigning values to &DEPT1:
// SET DEPT1=CRP100
//JSTEP EXEC TRANSACT
Continued
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
55/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 55 of 90
SET statements can be placed anywhere in a jobstream following the JOB statement. However,where they are placed will affect where they takeeffect.
The system assigns values to symbolicparameters as it encounters them. Therefore, a
new SET statement will change the value of aprevious SET statement. Similarly, values that areassigned on EXEC or PROC statements willchange the values assigned on previous SETstatements.
In the examples on the right, GRP100 would be
the value set by the system, since it is the lastvalue the system encounters.
Assigning Values Using SET Statement (contd)
//S1 EXEC TRANSACT,DEPT=GRP100
or
// SET DEPT=GRP100
//S1 EXEC TRANSACT
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
56/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 56 of 90
When you use a SET statement to assign a value to a symbolic parameter, when does the newvalue apply?
A. Only if the symbolic parameter did not have a previous value
B. For the next use of the symbolic parameter only
C. To all subsequent uses of the symbolic parameter, unless changed again
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
57/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 57 of 90
Like DDNAME, symbolic parameters can also be specified for DD statement operands, if the values forthose operands are likely to change.
When do you use DDNAME and when do you specify symbolic parameters?
Specify symbolic parameters in a procedure if only a limited number of DD statement operands arelikely to vary.
If, however, completely different data sets with different attributes are likely to be used, consider usingthe DDNAME operand instead. In that way, the users will not have to assign multiple values to multiplesymbolic parameters.
Symbolic Parameters for DD Statement Operands
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
58/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 58 of 90
Assume that the identification of the data setcontaining customer transactions for TRANSACT
varies from week to week.
A data set named WEEK1 contains thetransactions for the first week in the quarter, adata set named WEEK2 contains transactions for
the second week in the quarter, and so on.
You can create your procedure to accommodate
this week-to-week change in the data set name by
specifying the symbolic parameter DSN=&WEEK
on the DD statement in the procedure definition,
as shown on the right.
DD Statement Operands An Example
//PSTEP1 EXEC PGM=PROG1
//DD1 DD DSN=&WEEK,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
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
59/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 59 of 90
How to assign values with the EXECstatement?
When invoking the procedure, you simply code
the appropriate value for&WEEK on EXEC
statement, as shown on the right.
How to assign values with the SET statement?
Alternatively, you can assign a value with a SET
statement coded at an appropriate place in the job
stream, as shown on the right.
Assigning Values
Assigning values with EXEC statement:
//JSTEP EXEC TRANSACT,WEEK=WEEK1
Assigning values with SET statement:
// SET WEEK=WEEK1
//JSTEP EXEC TRANSACT
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
60/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 60 of 90
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
When you create a procedure, which of the following options enable you to accommodatevarying values for DD statement parameters?
A. Code the DDNAME parameter to represent a data set and its attributes
B. Code an override DD statement
C. Code symbolic parameters for specific DD statement operands
D. Code an addition DD statement
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
61/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 61 of 90
Review the JCL statements from a procedure named ANYPROC. Code symbolic parametersto meet the following specifications:
Code a symbolic parameter for the data set name for the input data set in statement DD1. Name it&INPUT.
//S1 EXEC PGM=PROG1,ACCT=&GRP
//DD1 DD DSN=______,DISP=SHR
Code a symbolic parameter for the VOL=SER= parameter for the data set in statement DD2. Nameit &SERNO. Specify shared access mode {SHR}.
//DDS DD DSN=CKDATA,UNIT=3390,
// VOL=SER=____________
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
62/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 62 of 90
Code a statement to invoke procedure ANYPROC from the previous example, andassign values to the symbolic parameters as follows:
1. Assign a value of MYDATA to the &INPUT symbol.
2. Assign a value of 692912 to the &SERNO symbol.
//JSTEP EXEC ANYPROC,____________
Are We on Track?
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
63/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 63 of 90
Nullify With EXEC or DD statement parameters, to return them to theinstallation-defined default.
PGM An EXEC statement parameter that names the program to execute.
MVS/ESA A MVS operating system environment that supports ESA/370.
Glossary
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Glossary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
64/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 64 of 90
Now that you have completed this topic, you should be able to:
Define symbolic parameters
Explain the standards/rules for forming symbolicparameters names
Assign values to symbolic parameters
Nullify symbolic parameters
Specify symbolic parameters
Topic Summary
Unit: Creating Effective Procedures Topic: Using Symbolic Parameters
Summary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
65/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 65 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
66/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 66 of 90
At the end of this topic, you will be able to:
Assign default values
Specify default values for symbolic parameters
Nullify or override default values
Topic Objectives
Unit: Creating Effective Procedures Topic: Assigning Default Values
Introduction
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
67/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 67 of 90
General Rules and Format
At the time you create symbolic parameters, you can also assign default values. You do so on the PROCstatement of the procedure. If the user determines that the values are appropriate at the time the procedure isexecuted, the user does not have to assign values.
The rules for specifying default values for symbolic parameters are as follows:
Specify default values for symbolic parameters in the operand field of the PROC statement. (A
PROC statement must always precede an in-stream procedure definition. The PROC statement isrequired in a cataloged procedure definition only if you are assigning default values to one or moresymbolic parameters.)
Specify each symbolic parameter without the preceding ampersand, followed by an equal sign andthe default value.
Separate the default value specifications for multiple symbolic parameters by a comma.
You can assign default values for symbolic parameters in any sequence. You are not required tofollow the sequence in which the symbolic parameters occur in the procedure definition.
Unit: Creating Effective Procedures Topic: Assigning Default Values
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
68/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 68 of 90
The example on the right illustrates theTRANSACT procedure definition, with default
values assigned to &DEPT and &PROG on the
PROC statement.
Nullifying TRANSACT Definition
TRANSACT PROC DEPT=G300,PROG=PROG2
//PSTEP1 EXEC PGM=PROG1,ACCT=&DEPT
//DD1 DD DSN=&WEEK,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=&PROG,ACCT=&DEPT
//DD5 DD DSN=&&VALID,
// DISP=(OLD,DELETE)
//DD6 DD SYSOUT=A
Unit: Creating Effective Procedures Topic: Assigning Default Values
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
69/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 69 of 90
The example on the right illustrates thethe statement to invoke TRANSACT.
When invoking the procedure, you do not have to
assign values if the default values are
appropriate.
Otherwise, the user can code an EXEC statementto nullify or override the default values.
Nullifying Statement to Invoke TRANSACT
//JSTEP EXEC TRANSACT,DEPT=,
// PROG=TSTPRG
Unit: Creating Effective Procedures Topic: Assigning Default Values
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
70/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 70 of 90
Which of the following statements are true of assigning default values for symbolic parameters?
A. They are assigned on the EXEC statement that invokes the procedure
B. You can assign default values for as many symbolic parameters as needed
C. They can be nullified by the procedure user
D. They are preceded by an ampersand {&}
E. They are assigned on the PROC statement
Are We on Track?
Unit: Creating Effective Procedures Topic: Assigning Default Values
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
71/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 71 of 90
Now that you have completed this topic, you should be able to:
Assign default values
Specify default values for symbolic parameters
Nullify or override default values
Topic Summary
Unit: Creating Effective Procedures Topic: Assigning Default Values
Summary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
72/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 72 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
73/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 73 of 90
At the end of this topic, you will be able to:
Design a procedure
Topic Objectives
Unit: Creating Effective Procedures Topic: Summary Example
Introduction
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
74/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 74 of 90
To apply what you have learned about DDNAMEand symbolic parameters, assume you have tocreate a procedure {NEWTRANS} toaccommodate the following executionenvironment:
Several different departments use the procedure.
Each department is required to supply itsdepartment number in the ACCT parameter.
Design a Procedure
DEPT310
WEEK 1
Unit: Creating Effective Procedures Topic: Summary Example
Concepts
Continued
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
75/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 75 of 90
The source of the input transaction data can varyfrom week to week.
PROG1 is always executed in the first procedurestep. However, the identification of the programexecuted in the second procedure step can varyfrom execution to execution.
Design a Procedure (contd)
DEPT 350
WEEK 2
Unit: Creating Effective Procedures Topic: Summary Example
Concepts
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
76/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 76 of 90
Which of the following should you include in the procedure to meet the needs of the processingenvironment? Choose all that apply.
A. A symbolic parameter for PGM=in the first procedure step
B. A symbolic parameter for PGM=in the second procedure step
C. A SET statement
D. A symbolic parameter for ACCT=in the EXEC statement
E. Specific values for all data set names and attributes
Are We on Track?
Unit: Creating Effective Procedures Topic: Summary Example
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
77/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 77 of 90
Given that the data set names and attributes of the input data set are likely to vary widely,
which of the following would best achieve the execution-time objectives?
A. Use the DDNAME parameter to represent the input data set.
B. Code data specifications needed for typical use for the input data set.
C.Assign symbolic parameters for the input data set name and attributes.
Are We on Track?
Unit: Creating Effective Procedures Topic: Summary Example
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
78/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 78 of 90
Complete the JCL statements for the sample procedure as per the following instructions:
In step 1, specify a symbolic parameter for ACCT in PSTEP1. Name it &DEPT.
In step 2, use the DDNAME parameter for the input data set. Code the value as INPUT.
In step 6, specify a symbolic parameter for PGM in PSTEP2. Name it &PROG2.
1. //PSTEP1 EXEC PGM=PROG1,__________
2. //DD1 DD ____________
3. //DD2 DD DSN=MASTER,DISP=SHR
4. //DD3 DD SYSOUT=A
5. //DD4 DD DSN=&&VALID,DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
6. //PSTEP2 EXEC _____________
7. //DD5 DD DSN=&&VALID,DISP=(OLD,DELTE)
8. //DD6 DD SYSOUT=A
Are We on Track?
Unit: Creating Effective Procedures Topic: Summary Example
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
79/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 79 of 90
Code the JCL used to invoke the sample procedure and provide the following execution-timeinformation:
In step 2, code a department number of G300 and the program named TESTPRG for execution inPSTEP2
In step 3, code input transactions from cards in the job stream.
1. //JSTEP EXEC TRANSACT,
2. // ____________________
3. //PSTEP1.________ *
(input data records)
/*
Are We on Track?
Unit: Creating Effective Procedures Topic: Summary Example
Review
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
80/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 80 of 90
Now that you have completed this topic, you should be able to:
Design a procedure
Topic Summary
Unit: Creating Effective Procedures Topic: Summary Example
Summary
z/OS MVS JCL Advanced
7/30/2019 jcl nivel avanzado unidad 2
81/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 81 of 90
UNIT Creating Effective Procedures
Designing Procedures
Using the DDNAME Parameter
Using Symbolic Parameters
Assigning Default Values
Summary Example
Cataloging Procedures
Topics:
z/OS MVS JCL Advanced
U i C i Eff i P d T i C l i P d
7/30/2019 jcl nivel avanzado unidad 2
82/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 82 of 90
At the end of this topic, you will be able to:
Catalog procedures using IEBUPDTE Utility
Catalog procedures using JCLLIB
Topic Objectives
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Introduction
z/OS MVS JCL Advanced
U it C ti Eff ti P d T i C t l i P d
7/30/2019 jcl nivel avanzado unidad 2
83/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 83 of 90
What is an IEBUPDTE Utility?
After testing and debugging a new procedure, you may want to catalog it for general use. Cataloged
procedures are generally placed in a system library named SYS1.PROCLIB. This can be accomplished by
using the IEBUPDTE Utility.
Using IEBUPDTE Utility
IEBUPDTE is designed to add and replace procedures in a partitioned data set.
PARTITIONED DATA SET
SYS1.PROCLIBTRANSACT
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Concepts
z/OS MVS JCL Advanced
U it C ti Eff ti P d T i C t l i P d
7/30/2019 jcl nivel avanzado unidad 2
84/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 84 of 90
How to place cataloged procedures?
Cataloged procedures can be placed in a user defined PDS using IEBUPDTE. The JCLLIB statement is
coded as:
// JCLLIB ORDER=(data set name, data set name, data set name)
The JCLLIB statement can be placed after the JOB statement, and before the statement executing theprocedure. You can list one or more libraries in the order you want them searched.
Using JCLLIB
PARTITIONED DATA SET
TRANSACTUSER DEFINED
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Concepts
z/OS MVS JCL Advanced
U it C ti Eff ti P d T i C t l i P d
7/30/2019 jcl nivel avanzado unidad 2
85/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 85 of 90
Assume TRANSACT is placed in a privateprocedure library named MY.PROCLIB.
When executing TRANSACT, you should codethe JCLLIB statement after the JOB statement,but before the statement executing TRANSACT,as shown on the right.
Using JCLLIB An Example
//JSTEP1 JOB 1234,ROSE,
// JCLLIB ORDER=MY.PROCLIB
//JSTEP2 EXEC TRANSACT
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Concepts
z/OS MVS JCL Advanced
Unit: Creating Effective Procedures Topic: Cataloging Procedures
7/30/2019 jcl nivel avanzado unidad 2
86/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 86 of 90
Which of the following could you use to catalog a procedure?
A. IEBGENER Utility
B. JCLLIB statement
C. IEBUPDTE Utility
Are We on Track?
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Review
z/OS MVS JCL Advanced
Unit: Creating Effective Procedures Topic: Cataloging Procedures
7/30/2019 jcl nivel avanzado unidad 2
87/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 87 of 90
Glossary
JCLLIB A statement that enables you to store cataloged procedures in your ownlibrary and search it for procedures.
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Glossary
z/OS MVS JCL Advanced
Unit: Creating Effective Procedures Topic: Cataloging Procedures
7/30/2019 jcl nivel avanzado unidad 2
88/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 88 of 90
Now that you have completed this topic, you should be able to:
Catalog procedures using IEBUPDTE Utility
Catalog procedures using JCLLIB
Topic Summary
Unit: Creating Effective Procedures Topic: Cataloging Procedures
Summary
z/OS MVS JCL Advanced
Unit: Creating Effective Procedures
7/30/2019 jcl nivel avanzado unidad 2
89/90
Copyright IBM Corp., 2000, 2004. All rights reserved. Page 89 of 90
Now that you have completed this unit, you should be able to:
Code statements that are required in a procedure definition
Identify statements that are not allowed in a proceduredefinition
Specify the criteria for creating a useful procedure
Code the DDNAME operand on one or more DDstatements in a procedure definition
Unit Summary
Unit: Creating Effective Procedures
Summary
Continued
z/OS MVS JCL Advanced
Unit: Creating Effective Procedures
7/30/2019 jcl nivel avanzado unidad 2
90/90
Now that you have completed this unit, you should be able to:
Specify DD statements to resolve the DD operand
Code symbolic parameters on the EXEC and DDstatements of a procedure
Assign user values to symbolic parameters
Specify default values for symbolic parameters on thePROC statement of a procedure
Nullify and override symbolic parameter default values
Unit Summary (contd)
Unit: Creating Effective Procedures