z/OS MVS JCL Intermediate
z/OS MVS JCL Intermediate
UNIT
Page 2
Introduction
Page 3
Specify the parts of a job log that can help you analyze
the effective JCL
Introduction
Page 4
UNIT
Page 5
Topic Objectives
At the end of this topic, you will be able to:
Introduction
Page 6
Effective JCL
What is an effective JCL?
When a procedure is invoked, the system
combines both the submitted JCL and the JCL
that is stored with the procedure. The resulting
JCL is called the effective JCL.
Effective JCL is the JCL in effect at the time of job
execution.
Concepts
Page 7
Concepts
To ensure that the effective JCL satisfies all the processing requirements, particularly if it contains a
number of overrides and additions
Page 8
Job Log
An effective JCL is checked by examining the job
log.
System Messages:
Concepts
System messages
Resource-allocation/job-step
termination-status messages
Page 9
//
JOB
...MSGLEVEL=1
//MYJOB
//
//JSTEP1
Concepts
JOB
EXEC
377-44-1247,
D.ROSE,MSGLEVEL=(1)
TRANSACT
Page 10
Are We on Track?
Enter the subparameter that you would code on a job statement to obtain a listing of procedure
statements, if they are not included by default:
//MYJOB
Review
JOB
123,D.GREEN______________________________
Page 11
Glossary
MSGLEVEL
Glossary
Page 12
Topic Summary
Now that you have completed this topic, you should be able to:
Summary
Page 13
UNIT
Page 14
Topic Objectives
At the end of this topic, you will be able to:
Verify the job log listing
Identify special notations in a job log listing
Identify the sequence of JCL statements in effect
Identify JCL that invokes a cataloged procedure
Identify and analyze an effective JCL in a job log
Introduction
Page 15
Concepts
Page 16
Statement identified
Cataloged
Procedure
In-stream
Procedure
//
//
Statements you submit with the job, including in-stream procedure definitions
(if applicable) and any alterations to DD statements.
XX
++
X/
+/
XX*
++
***
***
The table above illustrates the notations used on a job log to identify JCL statements.
Concepts
Page 17
Are We on Track?
Match the job log notations below with the kinds of statements they identify.
Review
1. +/
2. XX
3. //
4. ***
Page 18
Concepts
//LA$TEST2
//
//JOBLIB
//
//TRANSACT
//PSTEP1
//DD1
//
//DD2
//
//DD3
//DD4
//
//
//PSTEP2
//DD5
//
//DD6
//JSTEP
JOB 31SPC090156W,ROSE,
CLASS=B
DD DSN=TSOCHIS.TESTJCL.LOAD,
DISP=SHR
PROC
EXEC
PGM=PROG1
DD DSN=TSOCHIS.INTRAN,
DISP=SHR
DD DSN=TSOCHIS.MASTER,
DISP=SHR
DD SYSOUT=A
DD DSN=&&VALID,UNIT=SYSDA,
DISP=(NEW,PASS),
SPACE=(TRK,(1,1))
EXEC PGM=PROG2
DD
DSN=&&VALID,
DISP=(OLD,DELETE)
DD
SYSOUT=A,PEND
EXEC
TRANSACT
Page 19
JOB
DD
PROC
EXEC
DD
DD
DD
DD
EXEC
DD
DD
PEND
EXEC
PROC
EXEC
DD
DD
DD
DD
EXEC
DD
DD
(31SPCO3090156W),ROSE,CLASS=B
DSN=TSOCHIS.TESTJCL.LOAD,DISP=SHR
PGM=PROG1
DSN=TSOCHIS.INTRAN,DISP=SHR
DSN=TSOCHIS.MASTER,DISP=SHR
SYSOUT=A
DSN=&&VALID,UNIT=SYSDA,DISP=(NEW,PASS),SPACE=(TRK,(1,1))
PGM=PROG2
DSN=&&VALID,DISP=(OLD,DELETE)
SYSOUT=A
TRANSACT
PGM=PROG1
DSN=TSOCHIS.INTRAN,DISP=SHR
DSN=TSOCHIS.MASTER,DISP=SHR
SYSOUT=A
DSN=&&VALID,UNIT=SYSDA,DISP=(NEW,PASS),SPACE=(TRK,(1,1))
PGM=PROG2
DSN=&&VALID,DISP=(OLD,DELETE)
SYSOUT=A
The JCL portion of the job log for LA$TEST2 is shown above.
Concepts
Page 20
Are We on Track?
Review the effective JCL for job LA$TEST2, on the previous page. The // notation identifies the
JCL statements that are submitted with the job that invokes the TRANSACT procedure. Which of
the following are included?
A. JOB statement
B. JOBLIB DD statement
C. DD override statement
D. TRANSACT procedure definition
Review
Page 21
LKED.SYSLMOD is an override DD
statement that specifies the data set and
member name
Continued
Concepts
Page 22
//JSTEP2 EXEC
COBUCL
//COB.SYSIN
DD
//
DSN=TESTJCL.CNTL(PROG2),
//
DISP=SHR
//LKED.SYSLMOD DD
//
DSN=TESTJCL.LOAD(PROG2),
//
DISP=SHR
LKED.SYSLMOD is an override DD
statement that specifies the data set and
member name
Concepts
Page 23
Page 24
Are We on Track?
Review the effective JCL in job log for LA$MYJOB, on the previous slide. Notice that the system
merges the cataloged procedure statements into the job stream at the appropriate places. Order
the following statements to reflect the sequence of effective JCL in the example.
A. Statements of procedure step COB
B. EXEC statement to invoke the procedure
C. Addition statement for COB
D. JOB statement
E. DD statement that is overridden
F. Statement of procedure step LKED
G. Override statement for procedure step LKED
Review
Page 25
Glossary
JOBLIB
Glossary
Page 26
Topic Summary
Now that you have completed this topic, you should be able to:
Summary
Page 27
UNIT
Page 28
Topic Objectives
At the end of this topic, you will be able to:
Introduction
Page 29
Continued
Concepts
Page 30
Job Log
1. //LA$TEST2
2. //JOBLIB
//TRANSACT
//PSTEP1
//DD1
//DD2
//DD3
//DD4
//PSTEP2
//DD5
//DD6
//
3. //JSTEP
4. ++TRANSACT
5. ++ //PSTEP1
6. ++//DD1
7. ++//DD2
8. ++//DD3
9. ++//DD4
10. ++//PSTEP2
11. ++//DD5
12. ++//DD6
JOB
DD
PROC
EXEC
DD
DD
DD
DD
EXEC
DD
DD
PEND
EXEC
PROC
EXEC
DD
DD
DD
DD
EXEC
DD
DD
(31SPCO3090156W),ROSE,CLASS=B
DSN=TSOCHIS.TESTJCL.LOAD,DISP=SHR
PGM=PROG1
DSN=TSOCHIS.INTRAN,DISP=SHR
DSN=TSOCHIS.MASTER,DISP=SHR
SYSOUT=A
DSN=&&VALID,UNIT=SYSDA,DISP=(NEW,PASS),SPACE=(TRK,(1,1))
PGM=PROG2
DSN=&&VALID,DISP=(OLD,DELETE)
SYSOUT=A
TRANSACT
PGM=PROG1
DSN=TSOCHIS.INTRAN,DISP=SHR
DSN=TSOCHIS.MASTER,DISP=SHR
SYSOUT=A
DSN=&&VALID,UNIT=SYSDA,DISP=(NEW,PASS),SPACE=(TRK,(1,1))
PGM=PROG2
DSN=&&VALID,DISP=(OLD,DELETE)
SYSOUT=A
Page 31
TIME
An example of a system message is shown above. System messages appear at the beginning of a job log.
They give information such as time of the job, the job number assigned internally, and job statistics.
If the job is not run because of a JCL error, a system message indicating the error will appear in this part of
the job log.
Concepts
Page 32
TO ON
STEP WAS
TO ON
STEP WAS
The example above shows detailed error messages for LA$TEST. These types of messages appear at the
end of the job log.
The two warning messages that appear here to draw the users attention to unresolved DDNAME keyword
operands are JCL statements 19 and 35. In this case, the unresolved operands do not prevent the job from
executing. A later resource allocation statement indicates that the data set was assigned dummy status.
Concepts
Page 33
Are We on Track?
Match the items from a job log with the kind of information they can give you about a procedure:
Review
2. Effective JCL
4. System Messages
Page 34
DD
19//JSTEP2
DDNAME=SYSIN
EXEC
COBUCL
Sometimes the statement number associated with an error message is not the actual statement to which the
message applies. In this example, statement 19 is associated with the error message. However, the error
actually occurs in statement 18 as shown in the job log.
As the system interpreted the JCL for this job, it expected statement 19 to be a DD statement to assign a value
to the DDNAME operand in statement 18. When the system encountered an EXEC statement instead, it
created a message for statement 19. However, the reason for the diagnostic actually appears in statement 18.
Concepts
Page 35
JES2
SPC
16.31.28
16.31.28
16.31.29
16.31.29
JOBO3361
JOBO3361
JOBO3361
JOBO3361
LASTEST9
IEF4581
IEC1301
LASTEST9
As another example of interpreting error messages, examine the system messages for a job named
LASTEST9 as shown above to answer the question on the next slide.
Concepts
Page 36
Are We on Track?
In the example on the previous slide, which one of the following problems is identified by the
system messages:
A. The job did not execute
B. DD statement DD2 is missing
C. There was a JCL error
D. An operand was unresolved
Review
Page 37
Concepts
Effective JCL:
1.//LASTEST9 JOB 12345,ROSE,CLASS=B
2.//JOBLIB DD DSN=TEST.JCL,DISP=SHR
//TRANSACT PROC
//PSTEP1 EXEC PROG=PROG1
//DD1 DD
DSN=INTRAN,DISP=SHR
//DD3 DD SYSOUT=A
. . .
9.//PSTEP1.DDIN DD DSN=MASTER,
//
DISP=SHR
Page 38
Are We on Track?
Refer to the effective JCL for LASTEST9 on the previous slide. Based on this JCL, which of the
following do you think is the likely cause of the error?
A. An incorrectly sequenced addition statement
B. An invalid name for an addition statement (DDIN, not DD2)
C. An incorrectly sequenced override statement
Review
Page 39
Glossary
Unresolved
Glossary
Page 40
Topic Summary
Now that you have completed this topic, you should be able to:
Summary
Page 41
UNIT
Page 42
Topic Objectives
At the end of this topic, you will be able to:
Introduction
Page 43
Concepts
Page 44
A common procedure usage error is EXEC statement modifications that are not in correct sequence, that is,
not in procedure step sequence. The messages below indicate the kind of system and error message that
might result:
The system messages listed at the beginning of the job log indicate that the job did not execute
because of a JCL error.
The detailed error message at the end of the job indicates that the step to be overridden was not
found in the procedure. The offending statement is statement number 3 of effective JCL.
Continued
Concepts
Page 45
Concepts
3.//JSTEP EXEC
//
//
TRANSACT,
TIME.PSTEP2=1,
PARM.PSTEP1=NOCHECK
Page 46
3.//JSTEP EXEC
//
//
TRANSACT,
TIME.PSTEP2=1,
PARM.PSTEP1=NOCHECK
Concepts
Page 47
Are We on Track?
Review the statement used to invoke the TRANSACT procedure in the previous example:
3. //JSTEP
EXEC
TRANSACT,TIME.PSTEP2=1,PARM.PSTEP1=NOCHECK
Code a correct JCL statement to invoke the procedure with the specified EXEC statement additions.
//JSTEP
Review
EXEC
TRANSACT,__________________
Page 48
Concepts
The system messages listed at the beginning of the job log indicate that the job did not execute
because of a JCL error.
The detailed message at the end of the job indicates an unidentified keyword. The offending
statement is statement number 3 of the effective JCL, where PARM is spelt as PATM.
Copyright IBM Corp., 2000, 2004. All rights reserved.
Page 49
Are We on Track?
Examine statement number 3 of the effective JCL listing. Identify the error in the EXEC statement
coded to invoke the procedure.
3. //JSTEP
//
EXEC
TRANSACT
PARM.PSTEP1=CHECK
Review
Page 50
Sequence of DD Statements
Improper sequence of override and addition DD statements is another common JCL error. They can be more
difficult to diagnose than those for EXEC statements.
The specification of an addition DD statement before an override DD statement is a particularly difficult error
to isolate. If both types of DD statement are required for the same procedure step, the system does not
recognize this as an error. The program executes without detailed error messages. However, the error is
reflected in the output of the program, which may be based on incorrect data.
Sequencing rules for coding override and addition DD statements within a procedure step is as follows:
1. Specify all override DD statements for a procedure step in same order as in the procedure.
2. Specify any addition DD statements for that step.
Concepts
Page 51
//DD1
DD
DSN=INTRAN,DISP=SHR
3. //JSTEP
EXEC TRANSACT,
//
PARM.PSTEP1=CHECK
9. //PSTEP1.DD2 DD DSN=MASTER,
//
DISP=SHR
10.//PSTEP1.DD1 DD
//
DSN=NEWTRAN,DISP=SHR
INTRAN
NEWTRAN
(INTENDED OVERRIDE)
Continued
Concepts
Page 52
MASTER
10
01
INTRAN
(WRONG OVERRIDE)
NEWTRAN
10
01
(INTENDED OVERRIDE)
INCORRECT OUTPUT
Concepts
Page 53
1.//LASTEST
2.//JOBLIB
//
//TRANSACT
//PSTEP1
//DD1 DD
JOB...ROSE,CLASS=B
DD
DSN=TESTJECL,
DISP=SHR
PROC
EXEC
PGM=PROG1
DSN=INTRAN,DISP=SHR
-------3.//JSTEP
EXEC
TRANSACT,
//
PARM.PSTEP1=CHECK
4.++TRANSACT
PROC
5.++PSTEP1
EXEC
PGM=PROG1
6.//PSTEP1.DD1 DD
DSN=NEWTRAN,
//
DISP=SHR
++DD1
DD
DSN=INTRAN,DISP=SHR
Concepts
Page 54
Are We on Track?
Review the override statements that the user coded.
9. //PSTEP1.DD1 DD
//
10.//PSTEP1.DD2 DD
//
DSN=NEWTRAN,
DISP=SHR
DSN=MASTER,
DISP=SHR
Code the override statement to correct the error in the example shown above.
//PSTEP1________________________
Review
Page 55
Are We on Track?
Review the override statements that the user coded.
9. //PSTEP1.DD1 DD
//
10.//PSTEP1.DD2 DD
//
DSN=NEWTRAN,
DISP=SHR
DSN=MASTER,
DISP=SHR
Code the addition statement to correct the error in the example shown above.
//PSTEP1.DD1 DD DSN=NEWTRAN,DISP=SHR
//PSTEP1________________________
Review
Page 56
Topic Summary
Now that you have completed this topic, you should be able to:
Summary
Page 57
Summary
Specify the parts of a job log that can help you analyze
the effective JCL
Summary
Page 58