You are on page 1of 51

JCL

Day 1
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Course Plan


Day 1 : Introduction to JCL, JOB & EXEC statement , JES
commands

Day 2 : DD statements, JCL Procedures & IBM Utilities

Day 3 : Introduction to VSAM, GDG & SMS

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Pre-requisites


MVS Operating system and its subsystem TSO

Navigating through ISPF
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Topics beyond the scope


VSAM file-handling

User coded COBOL program execution
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Evaluation Mechanism
Component Marks Schedule
Test 100 After Day 3
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
References
Title Author Publisher
OS/390 and z/OS
JCL
Raul Menendez Murach
MVS JCL Doug Lowe Mike Murach &
Associates, Inc
MVS/VSAM Gary D Brown &
S.A.M. Smith
SPD
IBM Online
manuals
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Agenda for Day 1
Introduction to JCL
What is JCL
Why we need JCL
How we can use it

Sequence & priority of execution

Job statement
Syntax
Parameters

Exec statement
Syntax
Parameters
COND parameter
JES commands, JCL errors & Abends
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
J C
L
JOB CONTROL LANGUAGE
What does JCL stand for ?
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
What is JCL then?
Not a Procedural or OO Language

JOB CONTROL LANGUAGE

Interface between Programs & MVS OS.

Why JCL?

Sample JCL code


#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Sample JCL

//UseridJ JOB ,,NOTIFY=&SYSUID,CLASS=D,
// MSGLEVEL=(1,1),MSGCLASS=X
//* SAMPLE JCL
//STEP1 EXEC PGM=SEQPROC
//STEPLIB DD DSN=OPERN.CICS3.LOADLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//INFILE DD DSN=YourMainframeId.JCL.DAY2.FILE1,DISP=SHR
//OUTFILE DD DSN=YourMainframeId.JCL.DAY2.FILE2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(10,5),RLSE),
// DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB)

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Various stages of JCL execution
Determine
the
job
Create
the
JCL
Submit
the
JOB
JES
interprets
JCL and
passes it
to
MVS

MVS does
the work
User
Views and
Interprets
output
JES
collects
the output
and information
about
the JOB
System
Messages

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Various stages of JCL execution

Input

Conversion

Execution

Output

Hard copy

Purge

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
INPUT


INPUT
SPOOL
JCL
SYSIN
JES
MVS
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
CONVERSION

SPOOL
JCL
SYSIN
MVS
JES
PROCLIB
PROC
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
CONVERSION

JOB INTERPRETER - JES2
JES2
ADDRESS
SPACE
INITIATOR
ADDRESS
SPACE
PAY
JCL
INTERPRETER
PAY
CONTROL
BLOCKS
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
CONVERSION

JOB INTERPRETER - JES3
JES3
ADDRESS
SPACE
INITIATOR
ADDRESS
SPACE
PAY
JCL
INTERPRETER
PAY
CONTROL
BLOCKS
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
EXECUTION, OUTPUT, HARDCOPY and PURGE
Execution:
JES selects a job for execution , based upon job CLASS and
job selection PRTY

Ex: //ER5077 JOB ,,PRTY=8,CLASS=A

Allocation of datasets
SYSIN and SYSOUT

OUTPUT, HARDCOPY and PURGE
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JCL PROCESSING
JCL

SYSIN
SYSOUT
SPOOL
JES2 /
JES3
JES2 /
JES3
INITIATOR1
INITIATOR2
PRINTER
INPUT
STREAM
INITIATOR3
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JCL execution
JCL INITIATION
STEP INITIATION
ALLOCATION
PROGRAM EXECUTION
STEP TERMINATION
JOB TERMINATION
JCL
SYSIN
SYSOUT
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
QUESTIONS ???
JCL is used to write an application program ?
Yes/No

What are the different stages of JCL processing ?
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JCL statements
JOB - Job Identification

EXEC - Instruction for Execution

DD - Source of data to operate

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JOB STATEMENT
ACCT CLASS
NAME NOTIFY
MSGLEVEL
TYPRUN MSGCLASS
PRTY COND
RESTART USER
REGION PASSWORD
PERFORM TIME
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Positional Parameters

a) Account Information
b) Name

EX: //ER5077J JOB A123,NAME1


All these parameters are optional as far as JCL is concerned, they
are probably required by your installation.


#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Keyword Parameters
EX: //ER5077J JOB ,,CLASS=A

CLASS specifies the job class that is the nature of the job.
Installation will specify which of the 36 possible classes to use
which is from A to Z and 0 to 9 .
Installation establishes a default class that is in effect if CLASS
is omitted.

CLASS
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
A typical JOB Class assignment
Class Characteristics
A Execute within 15 min of submission
B Execute within 30 min of submission
C Execute within 60 min of submission
D Execute Overnight
H Will be held until released by operator
L Execute within 15 min of submission
T Requires Tape Processing
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Keyword Parameters
EX: //ER5077J JOB ,,MSGCLASS=A
MSGCLASS specifies the job scheduler message output class.
Job scheduler messages include all messages not printed by the
job steps being executed but the JCL messages and system
messages
Installation establishes a default class that is in effect if
MSGCLASS is omitted.
MSGCLASS
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Keyword Parameters
EX: //ER5077J JOB ,,MSGLEVEL=(1,1)
MSGLEVEL(statements,messages) specifies the printing of JCL
statements and allocation messages.

EX: MSGLEVEL(0,1) will print only JOB statement, and all the
allocation, JES, SMS and operator messages
By default it is MSGLEVEL(1,1)

MSGLEVEL
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Keyword Parameters

//ER5077J JOB ,,NOTIFY=&SYSUID
//ER5077J JOB ,,NOTIFY=ER5077

Requests the system sends a message to the TSO user id
specified when the job completes processing
NOTIFY
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT JOB PARAMETERS
Keyword Parameters
EX: //ER5077J JOB ,,TYPRUN=SCAN
TYPRUN checks the JCL and holds the job in the input queue.
TYPRUN = SCAN checks the JCL for syntax errors and suppresses execution
of the job
TYPRUN = HOLD holds the JCL in the input queue for later execution.It is held
until the operator releases it.
TYPRUN = JCLHOLD(JES2 only) similar to HOLD but the difference is it is
checked while it is not with the HOLD option.
TYPRUN = COPY(JES2 only) lists or duplicates the lines placed in the JOB
statement to the class assigned in the MSGCLASS parameter and suppresses
execution.
TYPRUN
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
SOME OTHER Keyword JOB PARAMETERS
PRTY=Priority : is related to the CLASS parameter. It assigns
priority to jobs which belong to the same class.priority numbers
range from (0-14) or (0-15) depending on installations.

TIME=(min,sec) : signifies how much CPU time the JOB can take to
run.
RESTART=STEPNAME :Forces the JOB execution to start from a
particular STEP.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
SOME OTHER keyword JOB PARAMETERS
REGION=96K :To override the default amount of workspace
assigned for the job.
COND=(4,LT) :Permits the execution of a steps to depend on the
return code from the previous steps.
ADDRSPC=REAL : It is used to specify whether the program is
to use REAL or VIRTual ADDRess SPaCe. Default is Virtual. If
Real is coded then the REGION parameter is also to be coded.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
EXEC STATEMENTS


PGM COND
PROC PARM
ACCT REGION
ADDRSPC TIME
PERFORM

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT EXEC PARAMETERS
positional parameters
EX: //STEP1 EXEC PGM=IEFBR14
The PGM parameter identifies the name of the program that is to be
executed.
EX: //STEP1 EXEC PROC=MYPROC
The PROC parameter identifies the name of the procedure that is to
be called.
PGM & PROC
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT EXEC PARAMETERS
keyword parameters
EX: //STEP1 EXEC PGM=IEBUPDT,PARM=LET,MAP,XREF
The PARM parameter is used to supply information to a program as
it executes.
PARM
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT EXEC PARAMETERS
keyword parameters
EX: //STEP1 EXEC PGM=IEBUPDT,ADDRSPC=VIRT
The ADDRSPC parameter is to indicate to the system that the job
step is to use either VIRT (virtual) or REAL (real) storage.
By default it is virtual.
ADDRSPC
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANT EXEC PARAMETERS
keyword parameters
EX: //STEP3 EXEC PGM=IEBUPDT,COND=(8,LE,STEP1)
The COND Permits the execution of steps to depend
on the return code from the previous steps.
The question should be is 8 less than the RC code of STEP1.
If Yes then Bypass STEP3
If No Execute STEP3
The COND parameter is also a JOB parameter.
COND
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COND parameter in detail
Format :

COND=( 0/4/6/8/12/16 , GT/GE/LT/LE/EQ/NE , step name , EVEN/ONLY )
RC comparison
code
(0 - 4095)
Condition
EVEN : step will be executed even if previous steps
terminate abnormally

ONLY : step will be executed only if previous steps
terminate abnormally.
Only code in the exec statement
not in job statement
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COND parameter examples
(in JOB statement)
//ER5077J JOB ,,COND=(4,LT)
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IFBR14
//STEP3 EXEC PGM=IEFBR14

STEP1 executes with RC = 0
STEP2 executes with
RC *S806 that is it is greater than 4
Job terminates
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COND parameter examples
(in EXEC statement)
//ER5077J JOB ,,CLASS=A
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=(0,EQ,STEP1)
STEP1 executes with RC = 0
STEP2 does not execute
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COND parameter examples
(in EXEC statement)
// ER5077J JOB ,,CLASS=A
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=ONLY
STEP1 executes with RC = 0
STEP2 does not execute
//ER5077J JOB ,,CLASS=A
//STEP1 EXEC PGM=IFBR14
//STEP2 EXEC PGM=IEFBR14
//STEP3 EXEC PGM=IEFBR14,COND=ONLY
STEP1 abends with RC = *S806
STEP2 does not execute ( if a single step abends all other steps
are bypassed if no COND statement is there )
STEP3 executes with RC = 0
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COND parameter examples
(in EXEC statement)
//ER5077J JOB ,,CLASS=A
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=EVEN
STEP1 executes with RC = 0
STEP2 executes with RC = 0
//ER5077J JOB ,,CLASS=A
//STEP1 EXEC PGM=IFBR14
//STEP2 EXEC PGM=IEFBR14
//STEP3 EXEC PGM=IEFBR14,COND=EVEN
STEP1 abends with RC = *S806
STEP2 does not execute ( if a single step abends all other steps
are bypassed if no COND statement is there )
STEP3 executes with RC = 0
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IMPORTANTEXECPARAMETERS
keyword parameters
(IF/THEN/ELSE/ENDIF)
EX: // IF STEPA.RC GE 4 THEN
//jcl statements
// ELSE
//jcl statements
// ENDIF
The IF/THEN/ELSE/ENDIF statement construct
provides a simple means of selectively executing job steps.
It is available in Release 4 or later , of MVS/ESA and
eliminates the need to struggle with the COND parameter.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
IF/THEN/ELSE/ENDIF parameter
examples
//ER5077A JOB 2933100P,ABC,MSGCLASS=A,CLASS=A
//STEP1 EXEC PGM=IEFBR14
// IF STEP1.RC GT 0 THEN
//STEP3 EXEC PGM=IEFBR14
//DD1 DD DSN=ER5077.TRUE.PS,DISP=(NEW,CATLG),
// VOL=SER=INUSR2,
// SPACE=(TRK,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
// ELSE
//STEP4 EXEC PGM=IEFBR14
//DD2 DD DSN=ER5077.FALSE.PS,DISP=(NEW,CATLG),
// VOL=SER=INUSR2,
// SPACE=(TRK,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
// ENDIF
/*
STEPNAME PROCSTEP RC
STEP1 00
STEP3 FLUSH
STEP4 00
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
COMMON keyword PARAMETERS
in JOB & EXEC
TIME

REGION

PERFORM

COND

ADDRSPC

ACCT

#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JOB ENTRY SUBSYSTEM
JES2 / JES3
JES2 or JES3 statements can be
included to communicate with JES concerning...
INPUT
OUTPUT
PROCESSING
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JES2 Control Statements
$COMMAND OUTPUT SIGNOFF
JOBPARAM PRIORITY SIGNON
MESSAGE ROUTE XEQ
NETACCT SETUP XMIT
NOTIFY
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
JES2 Control Statements
NOTIFY - direct jobs notification messages to a user.
PRIORITY or PRTY -Assign a selection priority for your job. Within a
job class, a job with a higher priority is selected for execution
sooner.
JES2 Control statements are preceded
with /* in col1 & col2.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Errors
JCL syntax errors.
JOB will not be submitted


JCL allocation errors.
JES2-subsequent steps will not get executed.
JES3-detects errors in the beginning.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Abend Failures
An ABEND failure occurs under the following conditions:

A program while executing, attempts to perform an instruction or
operation which the system recognizes as being impossible or
unacceptable.
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Causes of Abend Failures

Logic error
Resource unavailability
Exceeding limits (Time or Space on DASD)
Hardware Malfunction
User ABENDS
Operator intervention
Operating System failure
#
Copyright 2005,
Infosys Technologies Ltd
ER/CORP/CRS/OS02/003
Version No: 1.0
Thank You!

You might also like