Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

JCL (JOB CONTROL LANGUAGE)

JCL (JOB CONTROL LANGUAGE)


MVS CONCEPTS (Multiple Virtual Storage)
In IBM Mainframe environment to create and edit files using
ISPF (Interactive System Productive Facility).
JES2 (Job Entry Schedular2).
It is an MVS subsystem, installation is mandatory in order to implement input, output,
spooling and printing. It is a ecentrali!ed "nvironment (#"S$)
JES(Job Entry Schedular).
It is an Installation is mandatory and it is a centrali!ed environment t%ere is a global
process &%ic% controls all t%e ot%er processors and assigns t%e 'obs to t%em.
!"S#$A (!ult%&le '%rtual (tora)e # E*tended Arch%tecture).
Stands for multiple virtual storage(")tended *rc%itecture.
It is an IBM operating subsystem t%at supports $ +igabytes (+B) of address space.
!"S#ESA (!ult%&le "%rtual (tora)e # Enter&r%(e Sy(te+ Arch%tecture)
It is an IBM operating subsystem t%at supports additional address space for data.
It is an e)tension of mvs()a. , $- +B.
ABEN,
It is an abnormal situation t%at occurs during t%e e)ecution of a program
A!S (Acce(( !ethod Ser'%ce()
It is an IBM Services utility program used in creation and multiplication of Vsam and
non.Vsam datasets.
Allocat%on(
It re/uests for space on *S (irect *ccess System evice) it is a magnetic storage
evice.
,%(-
It is device t%at contains read, &rite and %eads and some electronic devices (components)
Trac-
It is a predefine pat% on *S
,ata(et
It is a unit of storage information t%at can be read from (or) &ritten to.
.r%+ary S&ace
It is a space used &%en dataset first created on *S
Secondary S&ace
0%is is a spaced defined on *S t%at is allocated space allocated is used up.
I.e. &%en primary space is used up t%en &e allocate secondary space.
"TOC ("olu+e Table o/ Content)
It is a group of records t%at contains dataset names, attributes of eac% datasets on *S.
JCL
#ob 1ontrol 2anguage is used to define and control 'ob to t%e o.s
Define: efinition Involves t%e programs need to be e)ecuted, t%e data for t%e program
and t%e se/uence of program.
Control3 1ontrol Involves t%e e)ecution (or) bypassing of a program in t%e se/uence
based on t%e results of t%e prior program e)ecution.
(4r)
,e/ JCL0 . It is an Interface bet&een 4perating System and Batc% #obs.

,e/ C1CS3 . It is an Interface bet&een 4perating System and 4nline process.
#12 1oding S%eet
5$6 55 57 8$ 9:
(( ;ame Field O&erat%on( O&erand( Co++ent(
#12 statement s%ould start &it% 0&o For&ard Slas%es ((() in 1olumn 5 and $.
< In t%e t%ird column indicates t%e line is to commented its 4ptional one when ever
we need we use that for commenting other wise we use column 3 for o! Name
"ur"ose
Name Field
It is an optional field if coded it s%ould start from column 6 and can %ave ma)imum 9
c%aracters (including c%aracters alp%a.numeric and national c%aracters are allo&ed in t%is
name field e.g. 2VS::6*, =V;=S, etc)
;40"3 First Character must !e #l"ha!etic $or% National S&m!ol !ut not a numeric
Num!er'
6 to 9 c%aracter is used for #ob ;ame
".g.
((2vs::6*
((>abc(o
((?abc:@
((?5$6-abcd &rong e)ceeds more t%an 9 c%aracters long.
O&erat%on(02
*n operation follo&s t%e name field and t%ere s%ould be at least one space bet&een name
field and operation. If name field is not coded t%en operations starts &it% t%e fourt%
column
4peration fields can be #ob, ")ec, statements.
O&erand(0 2
4perands are t%e parameters for t%e operations operands follo& operation and t%eir
s%ould be at least one space bet&een t%em a comma separates parameters and t%eir
s%ould not any space bet&een parameters if t%e operands are more t%an t%ey can be
continued in t%e ne)t line to continue current line. "nd t%e current line before 8$ &it%
* comma and start t%e ne)t line any &%ere bet&een t%e columns - to 57.
e.g.
((6 04 9 55 04 5- 57 85 8$ 9:
((;*M" 4P"A*0I4;S 4P"A*;S 14MM";0S
((2vs::6* #4B BP4SI0I4;(C"DE4A P*AM"0"ASF
Ba(%c JCL State+ent(
5. #ob Statement.
$. ")ec Statement.
6. Statement. (ata efinition Statement).
1. Job Statement
JOB02
It is a unit of &orG it %as to be e)ecuted and it contains several #12 statements t%at
instruct t%e operating system so it defines t%e 'ob parameters.
Synta)3 .
((#ob name #ob Bpositional(Gey&ord parametersF
0%is is very first statement in any #12 segment it identifies t%e beginning of a 'ob to t%e
operating system.
If t%e statement is missing t%e 4.S &ill be unable to e)ecute t%e #ob.
#ob ;ame3 .
It must start from column no3 6 and immediately follo&ing t%e double slas%es.
Rules for coding: -
Valid names can be 5 to 9 alp%a.numeric c%aracter in lengt% and special symbols can also
be included in t%e name.
0%e first c%aracter of t%e name must be *lp%abetic (or) ;ational.
It cannot be a numeric.
5. Valid names can be
((?*5$6-
((*5$6-@
$. Invalid ;ames
((5$6*B1
((*B15$6-@7 (e)acting more t%an 9 c%ar).
O&erand(0 2
4perands can be divided into $ types.
5. Positional Parameter (mandatory Parameter)
$. Cey&ord Parameter ( optional Parameter)
3. .o(%t%onal .ara+eter( ( !andatory .ara+eter).
0%e follo&ing $ positional parameters &ill be escribe as.
a. #ob *ccounting Information parameter ( account no, additional account
information)
b. Programmer ;ame parameter
a' #ob *ccounting Information Parameter
Synta)3 . #ob *ccounting Information (account number, additional *ccount
information)
*11;0H(=, D)
= H *B15$6 i.e. *ccount number
D H save *(c (or) current *(c i.e. *dditional accounting information.
!' Programmer ;ame Parameter (or) Program Functionality.
* +roup can be mentioned also it is used for ocumentation.
* ma(imum )* c%aracters allo&ed. I.e. a programmer name can not e)ceed more t%an
$: c%aracters.
2. 4ey5ord .ara+eter(O&t%onal &ara+eter)
It must follo& positional parameters t%ese are
5. 1lass
$. Priority
6. 1ondition
-. Aegion
@. 0ime
7. Aestart
3. Cla(( .ara+eter02
1lass Parameter assigns &%at is Gno&n as 'ob class.
* 'ob class it identifies t%e nature of a 'ob t%at is to be submitted.
Synta)3 . 1lass H #ob 1lass (*.I (or) numbers b(& : to J)
;ature of t%e 'ob in t%e sense mont%, year, &eeG daily etc information.
2. .r%or%ty .ara+eter0 2
It is related to t%e class parameter it assigns priority to t%e 'obs &%ic% belongs to
t%e same class name.
Synta)3 . PrtyH :.5@
If t%e 'ob is coded &it% : it is lo&est priority
If t%e 'ob is coded &it% 5@ it is assigned a %ig%est priority.
".g.
((2vs::6* 'ob5 accntH (*5$6, Savings), pgm nameHKsrinivasK, 1lassH7, prtyH9
((2vs::6* 'ob$ accntH (B6-@, 1urrent), pgm nameHKmeg%ans%K, 1lassH7, prtyH5-

;ote3 . #ob$ %as to be e)ecuted before 'ob5 bot% %as to be same class parameter
First 'ob$ &ill e)ecute because it %as %ig%er priority t%an 'ob5.
3' !e((a)e Cla((0 +
It determines t%e o(p devices to &%ic% t%e system messages and #12 messages are
&ritten.
Synta)3 . MS+12*SS H 4utput evices name
Aange from *.I (or) :.J.
6. !e((a)e Le'el0 2
0%is Parameter is used to specify t%e #12 and allocation messages &%ic% &ill be
recorded on t%e o(p devices specified a message class parameter.
MS+2"V"2 H Statements, Messages
MS+2"V"2H stmts (or)
MS+2"V"2H (, stmt)

E%ere stmts may be :, 5, $ and messages is values &%ic% can be : are 5.
S0M0S M"SS*+"S
: :
5 5
$
1oding L:K in stmt &ill results in t%e messages related to t%e o! Statement onl&
!e out"utted'
1oding L5K &ill result in all C, in the o! !eing out"ut in addition to it if an&
cataloged "rocedures are invo-ed $called% then the C, also !e out"ut'
1oding L$K &ill result in onl& the out"ut C, statements are "rinted.
Message field L:K &ill result in only in allocation and termination of messages
being o(p if t%e .o! terminates a!normall&'

1oding L5K &ill result in all allocation and termination messages being o(p
regardless of &%et%er t%e .o! terminates normall& $or% a!normall&. If t%is
parameter is not coded t%en all messages &ill be o(p if it is coded specific o(p &ill
be re/uested.
efault message level H (5, 5), msglevelH (5, 5)
7. Ty&e Run
It is used to specify t%e type of a 'ob processing suc% as &%et%er its e)ecution is
suppressed all toget%er.
Synta)3 . 0ype run H Mold
0ype run H Scan
0ype run HMold Aesults in t%e 'ob being %eld until furt%er notice %as been
received from t%e terminal.
0%is parameter is useful &%en 'obs &%ic% utili!e a lot of resources to be %eld until
a time &%en t%e system is relatively unused.
0ype run H Scan
0%is specifying t%e scan parameters results in t%e #12 being scanned for synta)
"rrors and reports t%em for re/uested o(p media.
ef 0ype run H scan
Scan is a Gey&ord parameter &%ic% can be used to c%ecG synta) errors of t%e 'cl
program.
e.g. 0ype run H scan(run.
4t%er &ise t%ere is a command &it% out running a 'ob &e can c%ecG t%e synta)
error of a 'cl by using t%e follo&ing command.
Command C/0 1 SC#N 1 EM
*re system defined commands &%ic% are used to c%ecG t%e
synta) error of #12 &it% out running a 'ob.
In 0S4(ISPF 1ommand Prompt Panel type3 #1CN #"M (or) #S1*;
2. EXEC (Execute Statement)
Syntax: - step name Exec Pgm= COBOL program name
e.g.
((2vs::6* #4B ;otifyHOsysuid, classH9, prtyH7, msgclassH*,
MsglevelH (5, 5)
((step5 "="1 PgmH14B42 program name
((6 to9 55 to 5- 57 to 85 8$ to 9:
((name field 4perations 4perands 1omments
//Job name Job <position/keyword>parameters
//Step name EXEC <position/Keyword>parameters
/e&word Parameters2+
It defines t%e step and step level information to t%e system a ma) of $@@ e)ecute steps
(4r) statements can be specified &it% in a single #ob.
1n 3 JOB no +ore than 277 8ob (te&( (or) E*ec (tate+ent( can be coded.
te! n"#e: . (step5 (or) any t%ing can be coded).
It is an optional field it is needed if &e &ant to restart a 'ob from, t%is step and for t%e
same reason it s%ould be uni/ue &it% in t%e 'ob.
Step name must consist of 5.9 alp%anumeric :.J national c%aracters.
E%ere as Step name first c%aracter must be *lp%abetic (or) national c%aracter.
It must be coded in column 6 immediately after $ slas%es.
.o(%t%onal .ara+eter( o/ an E*ec State+ent
P+M is an positional Gey&ord parameters of an e)ec statement. It codes t%e pgm
name (or) proc name to be invoGed.
0%e program name specified in t%e program parameter. Must e)ist eit%er in t%e system.
2ibraries are of $ types 5. 0emporary library $. Private library.
5
st
Priority given to private library
$
nd
priority given to temporary library
6
rd
priority given to system library
0%e program must be a member of a partitioned data set.
$osition $"r"#eter of E%EC t"te#ent:
Pgm H indicates t%e name of t%e 14B42 program ( utility of IBM.
a. Account%n) %n/or+at%on
Psed to supply t%e account information for 'ob statement it is an optional parameter. 0%e
ma) no of c%aracters t%at can include in accnt information including command is 5-$.
b..ar+
It is used to supply t%e information to our program as it is e)ecutes.
P*AM H Value
Value H is a string from 5 to 5:: c%aracters long.
If a string contains special c%aracters it must be enclosed &it% in single codes
L LParameters.
If t%e String is consists of several substrings t%en separated by comma (,).
*nd entire string must enclose &it% in a parent%esis (or) codes.
c. Addre(( S&ace
It is used to indicates to t%e system t%at t%e 'ob step is used eit%er Virtual (or) Aeal
Storage.
Synta)3 . *ddrspc H Virt (or) Aeal
d. ,2&r%or%ty
Psed to assign a dispatc%ing priority to a 'ob step it is used by t%e system to determine
t%e order in &%ic% tasGs are to be e)ecuted.
Synta)3 . .Priority H Value n < 57 Q Value $.
prty H value n < 57 Q value $.
Value 5 range from :.57.
Value $ ranges from :.57.
e. .er/or+
It is used to specify t%e perform group for t%e #ob step.
Synta)3 . Perform H ; (&%ere ; from 5 R JJJ)
/. R, (Re(tart ,e/%n%t%on)
It is used to specify t%e automatic restart of a 'ob level if it is *bends.
Synta)3 . A H A
A H A;1
A H ;A
A H ;1
0%e advantage of c%ecG point is if a 'ob is abended it can be restarted from t%e last c%ecG
point rat%er t%an from beginning of t%e Aun (or) point. Beginning of t%e 'ob itself.
E%ere A stands for restart
A;1 H *utomatic Aestart but no c%ecG point is suppressed.
;A H *utomatic Aestart is suppressed but t%e c%ecG point macro is not.
;1 H ;o 1%ecG points.
Co##on A&ends
5. SB68
Its an *B"; occurs &%en t%ere is no space in primary and secondary available
BlocG end.
$. S 68
;o secondary space available (or) no free space in directory blocG.
6. S" 68
;o more volumes available (or) no free space in allocated dataset again to reallocate t%e
dataset.
Co##on $"r"#eters for JOB t"te#ents "nd E%EC t"te#ent "re: -
'( Cond $"r"#eter(condition)
)( Region $"r"#eter
*( Ti#e $"r"#eter
'( Cond $"r"#eter (condition)
+s to s!ecif, t-e condition for Jo& "nd e.ecute st"te#ent /-et-er to ter#in"te or e.ecute
" 0o& or 0o& ste!(
If t%e cond parameter is coded on t%e 'ob statement as &ell as in t%e e)ec statement
0%en t%e specification on t%e 'ob statement nullifies t%e specification on t%e e)ecute
statement.
0%e cond parameter is used to control t%e e)ecution of subse/uence 'ob steps depending
on t%e condition code t%at is returned for a prior step.
Synta)3 . For #ob Statement
14; H (value, 4perator) (or)
(1omparison code, condition)
Synta)3 . For ")ec t"te#ent
(1omparison code, 1ondition, Step name)
Mere comparison code Aanges from : R -:J@
4perators (or) condition include
+0 (+reater t%an)
+" (+reater t%en or "/ual to)
"S ("/ual to)
;" (not e/ual to)
2"(less t%an or e/ual to)
20(less t%an)
+0 (+reater t%an)3.
By pass t%e current step is comparison code is +reater t%en t%at of Aeturn 1ode.
Cond 1 ONL2
4nly is used to specify a particular step is to e)ecute only if prior step terminates
abnormally.
Cond 1 E3EN
It is a Gey&ord used to specify a particular step is to e)ecute even if any one of t%e
previous steps terminated abnormally.
Ee cannot code bot% 4;2D and "V"; 14; for a same #ob Step
)( Region $"r"#eter
ItKs an optional Gey&ord parameter at t%e time a 'ob is run a default amount of &orGspace
is automatically assigned to itT t%is can be over&riting by t%e region parameter.
Synta)3 . Aegion H ;C (Gilo bytes) 5C &%ere ; H 5.
AegionH ;M (Mega bytes) 5M
Aegion H Value 5C
Aegion H Value $M
If region is specified in C format it s%ould be specified as an "ven no (C H even)
If &e specified in M format even and odd no can be specified (M H"ven O odd ;umber)
If Aegion is coded on bot% #ob Statement and ")ec Statement t%e region specification on
#ob statement &ill over &rite t%e e)ec statement.
S415
It means operational e)ceptional cases (or) miss spelled names (or) trying to read
* File &%ic% &as not opened
S14$
Period is missing at t%e end of a paragrap%
S416
2ogical error
S41-
Protection error. (4r) trying to read a file &%ic% &as not opened.
JOB L1B
#ob 2ib is a system defined library ( ata set &%ic% can be used to locate t%e all ob'ect
programs &%ic% are specified t%e #ob.
0%e #ob lib statement immediately follo&s t%e #ob statement.
It is a statement and it specifies &%ere t%e program t%at is specified by t%e ")ecute
statement resides.
0%e same 'ob lib statement can apply to all sub se/uent e)ecute statement.
It Must precede t%e ")ec i.e. ")ecute Statement.
It cannot be used in 1atalog Procedure.
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
((#ob name 4perations 4perands comments
((2VS::6* #4B ;otify H O sysuid
((#4B 2IB S; H 2vs::6*.srinivas.load5, ispH s%r
((Step5 "="1 Pgm H 14B42 pgm5
((Sysprint Sys out H <
((Sysout Sysout H <
((Step$ "="1 Pgm H 14B42 pgm $
((Sysprint Sys out H <
((Sysout Sysout H <
((Step6 "="1 Pgm H 14B42 pgm6
((Sysprint Sys out H <
((Sysout Sysout H <
#oblib must be coded after #ob statement
Note0 . ;o more t%en $@@ #ob steps (or) ")ec statements can be coded in 5 #oblib.
#oblib searc%es for t%e s&stem li!rar& i.e. it first searc% for private library and
ne)t temporary library and t%en system library.

You might also like