Escolar Documentos
Profissional Documentos
Cultura Documentos
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 2 of 90
Introduction
Page 3 of 90
Continued
Introduction
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 4 of 90
Introduction
Page 5 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 6 of 90
Introduction
Page 7 of 90
JOB
PROC A
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 8 of 90
EXEC
To code a procedure you should: 1. Execute the proper programs in the required sequence 2. Identify the data sets required by each program 3. Specify those program and data set parameters required for typical job execution environment
PGM=
DD
DSN=
Concepts
Page 9 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.
Review
Page 10 of 90
//PROCA
PROC
If you are inserting more than one in-stream procedure in a job, begin each one with a PROC statement that assigns a unique name to the procedure, as shown in the example on the right.
PROCA PROCB
The procedure name can be one to eight alphanumeric or national symbols. The first character must be alphabetic or national.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 11 of 90
JOB
//Procname PROC Symbolic Parameters
When you add a new procedure to a procedure library, the member name becomes the name by which the procedure is invoked.
PROCEDURE LIBRARY
Do not begin a cataloged procedure with a PROC statement unless you are assigning symbolic parameters.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 12 of 90
//
or
PEND
JOB PROC
//ENDPROC PEND
If you do not include a name on the PEND statement, at least one blank must separate the word PEND from the slashes in columns 1 and 2 of the statement, as shown on the right.
//ENDPROCA PEND
Concepts
Page 13 of 90
//JOBNAME JOB... //PROCA PROC... //PSTEP1 EXEC... //DD1... //DD2... //PSTEP2 EXEC... . . . // PEND
Concepts
Page 14 of 90
Concepts
Page 15 of 90
//JSTEP1 JOB /* //
//DD1 DD DATA 0001 8765 3864 /*JOBPARM COPIES=5 //JOBLIB DD DSN=MYLIB,DISP=SHR
The screen on the right shows examples of these statements that should not be in a procedure definition.
Concepts
Page 16 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. //
Review
Page 17 of 90
JOB
ORDERS
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 18 of 90
Concepts
Page 19 of 90
INTRAN
Input Transactions
MASTER
&&VALID
Concepts
SYSOUT CLASS A
Concepts
Page 21 of 90
In coding the JCL for the previous TRANSACT procedure, how many DD statements would you require? A. Two B. Four C. Five D. Six
Review
Page 22 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 for PROG2 B. A cataloged data set with the master customer list C. Printed output of the customer order list and invoices D. A cataloged data set with weekly transactions
Review
Page 23 of 90
Complete the JCL statements to fulfill the requirements of the sample application, as follows:
1. 2. 3. 4. 5. 6. 7. 8.
EXEC DD DD DD DD EXEC DD DD
PGM=PROG1 __________ DISP=SHR __________ DISP=SHR SYSOUT=A ______DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1)) __________ DSN=&&VALID,DISP=(OLD,DELETE) 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
Review
Page 24 of 90
Symbolic parameters
JES2
JES3
JOBLIB
Page 25 of 90
SYSOUT
Glossary
Page 26 of 90
Summary
Page 27 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 28 of 90
Introduction
Page 29 of 90
But does it simplify as much as possible the JCL that the user has to code at procedure execution?
EXEC DD DD
Concepts
Page 30 of 90
IN-STREAM INPUT
TAPE VOLUME
DASD
Page 31 of 90
Concepts
Parameter field
//
STEP1
DD
DDNAME=VALUE
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).
Concepts
Page 32 of 90
EXEC DD DD DD DD
PGM=PROG1 DDNAME=INPUT DSN=MASTER,DISP=SHR SYSOUT=A DSN=&&VALID, DISP=(NEW,PASS), UNIT=SYSDA, SPACE=(TRK,(1,1)) EXEC PGM=PROG2 DD DSN=&&VALID, DISP=(OLD,DELETE) DD SYSOUT=A
The value of the DDNAME parameter is not the same as the ddname of the statement.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 33 of 90
In the example on the right, DDNAME is resolved with the data set name MYDATA, with the unit and volume specifications shown.
Concepts
Page 34 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.
Review
Page 35 of 90
Code a DDNAME parameter to define the temporary data set PROG1 that refers to the DDNAME DD4. Define the actual data set characteristics using the name TSTDATA. TRANSACT Procedure:
EXEC DD DD DD DD
Review
Page 36 of 90
Complete the statement required at procedure invocation time to resolve DDNAME as an existing data set named MYDATA. JCL to invoke TRANSACT:
//SS1 //PSTEP1.TSTDATA
EXEC DD
TRANSACT DSN=MYDATA,DISP_______
_______
Review
Page 37 of 90
Glossary
Page 38 of 90
Summary
Page 39 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 40 of 90
Page 41 of 90
DEPT40
Concepts
Page 42 of 90
The user can assign a value to the symbolic parameter only once to change all recurring like operands in statements occurring through the entire procedure. This is useful if the same value is to be used for like operands in statements occurring throughout the procedure.
Concepts
Page 43 of 90
Concepts
Page 44 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.
Review
Page 45 of 90
Which are the symbolic parameters in the following JCL from a procedure named ANYPROC?
Review
Page 46 of 90
EXEC PGM=PROG1, ACCT=&DEPT DD DSN=INTRAN,DISP=SHR DD DSN=MAASTER,DISP=SHR DD SYSOUT=A DD DSN=&&VALID, DISP=(NEW,PASS), EXEC PGM=PROG2,ACCT&DEPT DD DSN=&&VALID, DISP=(OLD,DELETE) DD SYSOUT=A
ACCT=&DEPT
Concepts
Page 47 of 90
Concepts
Page 48 of 90
EXEC DD DD DD DD
PGM=&PROG1 DSN=INTRAN,DISP=SHR DSN=MASTER,DISP=SHR SYSOUT=A DSN=&&VALID, DISP=(NEW,PASS), UNIT=SYSDA, SPACE=(TRK,(1,1)) EXEC PGM=&PROG2 DD DSN=&&VALID, DISP=(OLD,DELETE) DD SYSOUT=A
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 49 of 90
Concepts
Page 50 of 90
Complete the S1 EXEC statement for a procedure named ANYPROC with the following symbolic parameters.
//S1
EXEC PGM=_________
// //DD1
DD
ACCT=________ DSN=&INPUT,DISP=SHR
Review
Page 51 of 90
Complete the JCL statement required to invoke procedure ANYPROC from the previous exercise, and specify the following: 1. Nullify the &DEPT symbol. 2. Assign a value of MYPROG to &PROG.
Review
Page 52 of 90
TRANSACT definition: //PSTEP1 EXEC PGM=PROG1, // ACCT=&DEPT1 //PSTEP2 EXEC PGM=PROG2, // ACCT=&DEPT2
Concepts
Page 53 of 90
TRANSACT definition: //PSTEP1 EXEC PGM=PROG1, // ACCT=&DEPT1 //PSTEP2 EXEC PGM=PROG2, // ACCT=&DEPT2 Assigning values to &DEPT1: // SET DEPT1=CRP100 //JSTEP EXEC TRANSACT
// //
The example on the right shows how to assign values to &DEPT using a SET statement.
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 54 of 90
Concepts
Page 55 of 90
When you use a SET statement to assign a value to a symbolic parameter, when does the new value 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
Review
Page 56 of 90
Concepts
Page 57 of 90
EXEC DD DD DD DD
PGM=PROG1 DSN=&WEEK,DISP=SHR DSN=MASTER,DISP=SHR SYSOUT=A DSN=&&VALID, DISP=(NEW,PASS), UNIT=SYSDA, SPACE=(TRK,(1,1)) EXEC PGM=PROG2 DD DSN=&&VALID, DISP=(OLD,DELETE) DD SYSOUT=A
Concepts
Page 58 of 90
Concepts
Page 59 of 90
When you create a procedure, which of the following options enable you to accommodate varying 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
Review
Page 60 of 90
Review the JCL statements from a procedure named ANYPROC. Code symbolic parameters to meet the following specifications:
Code a symbolic parameter for the data set name for the input data set in statement DD1. Name it &INPUT.
//DDS DD //
DSN=CKDATA,UNIT=3390, VOL=SER=____________
Review
Page 61 of 90
Code a statement to invoke procedure ANYPROC from the previous example, and assign 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.
Review
Page 62 of 90
PGM MVS/ESA
Glossary
Page 63 of 90
Summary
Page 64 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 65 of 90
Introduction
Page 66 of 90
Concepts
Page 67 of 90
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
Concepts
Page 68 of 90
//JSTEP //
EXEC
TRANSACT,DEPT=, PROG=TSTPRG
Concepts
Page 69 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
Review
Page 70 of 90
Summary
Page 71 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 72 of 90
Introduction
Page 73 of 90
WEEK 1
Continued
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 74 of 90
DEPT 350
WEEK 2
Concepts
Page 75 of 90
Which of the following should you include in the procedure to meet the needs of the processing environment? 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
Review
Page 76 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.
Review
Page 77 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. 2. 3. 4. 5. 6. 7. 8.
EXEC PGM=PROG1,__________ DD ____________ DD DSN=MASTER,DISP=SHR DD SYSOUT=A DD DSN=&&VALID,DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1)) EXEC _____________ DD DSN=&&VALID,DISP=(OLD,DELTE) DD SYSOUT=A
Review
Page 78 of 90
Code the JCL used to invoke the sample procedure and provide the following execution-time information:
In step 2, code a department number of G300 and the program named TESTPRG for execution in PSTEP2 In step 3, code input transactions from cards in the job stream.
Review
Page 79 of 90
Design a procedure
Summary
Page 80 of 90
UNIT
Topics:
Designing Procedures Using the DDNAME Parameter Using Symbolic Parameters Assigning Default Values Summary Example Cataloging Procedures
Page 81 of 90
Introduction
Page 82 of 90
TRANSACT
SYS1.PROCLIB
PARTITIONED DATA SET 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.
Page 83 of 90
TRANSACT
USER DEFINED
How to place cataloged procedures? Cataloged procedures can be placed in a user defined PDS using IEBUPDTE. The JCLLIB statement is coded as:
//
JCLLIB
The JCLLIB statement can be placed after the JOB statement, and before the statement executing the procedure. You can list one or more libraries in the order you want them searched.
Concepts
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 84 of 90
Concepts
Page 85 of 90
Which of the following could you use to catalog a procedure? A. IEBGENER Utility B. JCLLIB statement
C. IEBUPDTE Utility
Review
Page 86 of 90
Glossary
Page 87 of 90
Summary
Page 88 of 90
Continued
Summary
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 89 of 90
Summary
Page 90 of 90