You are on page 1of 16

INTERVIEW TOPICS (JCL):

JCL (Job Control Language): 1) What 3 basic statements consists a JCL? JOB statement, which identifies the start of the job, and information about the whole job, such as billing, run priority, and time space limits! EXEC statement, which identifies the program to be e"ecuted in this step of the job, and information about the step! DD #$ata $escription) statements, which identify a data file to be used in a step, and detailed info about that file! $$ statements can be in any order within the step! %) What are the % techni&ues to pass data from a JCL to a C'('L program? )assing a )arameter *ia )+,-. o /his techni&ue uses a )+,-.parameter 0eyword on the 121C statement in JCL! /he C'('L program re&uires a L345+61 71C/3'4! 887/1)91 121C )6-.),'64+-1,PAR !"data string: o When the data string is passed from JCL to C'('L it is preceded with a two;byte binary *alue that specifies the length of the data string! <or e"ample, if the data string is ten characters in length the actual information passed to the C'('L program would be a two;byte binary *alue of ten or ":999+: followed by the ten character data string! 3f the C'('L program is e"ecuted from JCL without a parameter the two;byte binary *alue would be =ero or ":9999:! /he L345+61 71C/3'4 of the C'('L program will contain the %;byte binary field #i!e! )+,-;L146/>) and the actual data #i!e! )+,-;$+/+)! LIN#A$E SECTION% 91 )+,-;(?<<1,! 9@ )+,-;L146/> 9@ )+,-;$+/+ o

)3C 7A#B) comp! )3C 2#%@C)!

/o 0now if there is a parameter passed to the C'('L program, chec0 the )+,-;L146/> if it is greater than =ero! 3f so, data was passed, otherwise no data was passed! +$$ )+,-;L146/> to D1,' 63E346 JCL;)+,-;L146/> 3< )+,-;L146/> F 9 -'E1 )+,-;$+/+#1G)+,-;L146/>) to -177+61;/12/ 14$;3< -a"imum length of )+,- field of the JCL 121C operator is 199 characters! Long )+,- *alues won:t fit into one line which can span only through pos! H1 and it might become necessary to continue )+,- field to the ne"t line! 3f )+,- field &onta'n( &o))a*+el')'te+ parameters, split )+,- field at the comma and enclose entire )+,- field into parenthesis! )+,continuation should be no further than pos! 1C of the ne"t line! 1"ampleG

o o

,,STEP- EXEC P$ !IE.BR-/0PAR !(-11234-50 ,, -1123466) ,,STEP6 EXEC P$ !IE.BR-/0PAR !("START!34,-2,12"0 ,, "STOP!34,66,12")

3f )+,- field +oe(n"t &onta'n &o))a*+el')'te+ parameters, enter )+,field data through pos! H1 and then continue e"actly in pos! 1C of the ne"t line and enclose entire )+,- field into apostrophes! 1"ampleG ----+----1----+----2----+----3----+----4----+----5----+----6----+----7//STEP3 EXEC PGM=IEFBR14,PARM='LONG PARAMETER FIELD IT!O"T COMMA DEL // IMITERS - CONTIN"ED IN COL"MN 16 OF T!E NEXT LINE' o 3f )+,- e"ceeds 199 chars, it is necessary to use 7I734 instead #ne"t techni&ue below) or input files!

)assing a )arameter *ia 7I734 o /his techni&ue re&uires 7I734 statement followed by the parameter to be placed in the JCL! 887/1)91 121C )6-.),'64+-1 887/1)L3( $$ $74./7/!+))L!L'+$L3(,$37).7>, ,,S7SIN DD 8 T9'( '( a :ara)eter ,8 88J 88 o o /he in;stream parameter should be terminated by a 8J! /he C'('L program re&uires an K+CC1)/ parameter from 7I734K to be coded in the C'('L program! 3f the 7I734 statement is missing in the JCL the +CC1)/ will +(14$ with a K<ile not foundK message! /o a*oid this it will be necessary to use a K887I734 $$ $?--IK statement in the JCL when a parameter is not being passed! accept 7I734;)+,+-1/1, from S7SIN

3) What are the different techni&ues for Conditional JCL? ?sing the C'4$ parameter o /his techni&ue is using the KC'4$.K parameter on the J'( or 121C statement! 887/1)91 121C )6-.),'64+-1,C'4$.#9,L/)

3f the step name is not specified in the C'4$ parameter, the return code of all pre*ious steps is chec0ed, otherwise it will only chec0 the return code of the specified step! 887/1)9% 121C )6-.),'64+-1,C'4$.#9,L/,7/1)91)

/he step with the C'4$ parameter will only be e"ecuted if the criteria specified is <+L71! 1"ampleG 887/1)9% 121C )6-.),'64+-1,C'4$.#L,L/,7/1)91) /he step 7/1)9% will be bypassed if C'4$.L is less than or e&ual to the ,eturn Code of the preceding job step #7/1)91)!

o o

+ C'4$ parameter specified on 121C statement determines whether step should be bypassed or e"ecuted! C'4$ parameter defined on the J'( statement will determine whether Job should be terminated at a certain point or continued! When C'4$ parameter is defined on the J'( statement, the system e*aluates condition specified in the C'4$ parameter before beginning of any job step and compares the code specified in the C'4$ parameter with the return code of all pre*ious job steps! 3f that condition is true, the rest of the job steps are bypassed!

?sing the 3< Construct o o /his techni&ue uses the 3<, />14, 1L71 and 14$3< statement construct! /he use of the C'4$ parameter can be *ery difficult to code and understand! 3t is recommended that we use the 3<, />14, 1L71 and 14$3< statement construct if you ha*e a choice! 3f is more straight;forward and easy to read! 1"ampleG 887/1)91 121C )6-.),'64+-11 ! ! ! 88J 88 3< #,C 1M 9) />14 887/1)9% 121C )6-.),'64+-1% ! ! ! 88 1L71 887/1)93 121C )6-.),'64+-13 ! ! ! 88 14$3<

B) What are the parameters needed to define a $+7$?

$efining the $ata 7ets #$+7$) used by a job step re&uires a $ata $efinition #or $$)

statement! + simple $$ statement re&uires the followingG o o o $$4+-1 $ata 7et 4ame #or $74) $isposition #or $37)) 0eyword!

1"ampleG 88ddname $$ DSN!data.set.name0 DISP!#status,normal-term,abnormal-term)

3n the preceding e"ample the ++na)e in the JCL $$ statement corresponds to the name used in the C'('L 71L1C/ statement! /he DSN! 0eyword and parameter specifies the fully;&ualified -E7 $ata 7et 4ame! /he DISP! 0eyword and parameter specifies the disposition as follows!
status OLD S;R OD De(&r':t'on /he dataset e"ists and this job step has e"clusi*e use of the dataset! /he dataset e"ists and other users and jobs can access the dataset, this is the default /he dataset should be 0ept and new records will be appended to the end of the dataset! /he dataset may or may not e"ist! 3f it does not e"ist then a data set will be created! /he dataset does not e"ist and will be created! De(&r':t'on $eletes the data set at the end of the step 5eeps the data set! )laces the entry in the system catalog or user catalog! <or a 41W data set this is the default! $eletes the entry from the system catalog or user catalog!

NEW normal-term DELETE #EEP CATL$ <NCATL$

abnormal-term De(&r':t'on DELETE #EEP CATL$ <NCATL$ 3ndicates that the data set is to be deleted at the end of a job step! 3ndicates that the data set is to be 0ept! 3ndicates that the system should place an entry in the system or user catalog! 3ndicates that the system is to delete the entry in the system or user catalog!

/he $$ statement for an 1"isting $ata 7etsG o o /he $$ name should be in positions 3;n #for a ma"imum of L characters) followed by a space! /he $$4+-1 should correspond to the name defined in the program! <or e"ample, with C'('L the name defined by the +77364 clause of the 71L1C/ statement! /he following is an e"ample of a $$ statement followed by a C'('L 71L1C/ statement with an +77364 clause! 88<3L13) $$ $74.-I!1237/346!$+/+71/,$37).7>, /he following is an e"ample of a C'('L 71L1C/ statement with an +77364 clause! 71L1C/ 34)?/;<3L1 +77364 to <3L13)

/he $$ statement for a new $ata 7etG o 'ther than the $$ 4ame, $74 and $37), new datasets also re&uire the ?43/, E'L, 7)+C1 and $C( parameters!

88<3L1') $$ $74.-I!41W!$+/+71/,$37).#41W,C+/L6,$1L1/1), 88 <NIT.7I7$+, 88 VOL!SER!/7/991, 88 SPACE.#CIL,39,B), 88 DCB.#,1C<-.<(,L,1CL.@1%,(L573D1.@1%9) o ?43/ )arameterG 3n 3(- -ainframe en*ironment, all de*ices ha*e an address assigned to them at the time they added to the system! $e*ices can be referenced using these addresses! ?43/ parameter is used to specify this address! 3n abo*e e"ample, <3L1') may reside on any of the de*ices which are grouped under the symbolic name 7I7$+ will be accessed!

E'L )arameterG /his parameter is used to identify the *olume serial number on which dataset resides! /he E'L dataset is used with dis0 and tape datasets! 7ub parameters used with E'L parameterG 1! 71, ; 7pecification of serial number %! ,1< ; ,eferencing E'L specification from a prior step 3! ),3E+/1 ; +llowing access to *olume by single user B! ,1/+34 ; 3nhibiting dismounting of *olume until end of job @! 71M ; 7pecification of se&uence in which *olumes are to be mounted

7)+C1 )arameterG /he 7)+C1 parameter is used to allocate space for datasets! +ll new data sets on dis0 *olumes must be allocated space! 7torage on dis0 *olumes can be allocated in units of Cylinders #CIL), /rac0s #/,5), (loc0s #(L5) and (ytes!

7ynta"G 7)+C1.#CIL,#primary,secondary,directory),,L71,C'4/36,-236,,'?4$) 4oteG 3nstead of CIL, We can use /,5 or (L5 /he primary amount can be conser*ati*e, with the secondary amount pro*iding a reser*e! /he secondary amount pro*ides for data set growth o*er time! -eaning of 7ub )arameter 1! ),3-+,I ; )rimary storage to be allocated at the time of data set created %! 71C'4$+,I ; +dditional storage to be allocated, if primary storage is not sufficient! ?p to 1@ times only! 3! $3,1C/',I ; 7pace for recording of name and location of partitioned data sets B! ,L71 ; ,e&uest for release of space pre*iously allocated unused space after completion of job @! C'4/36 ; ,e&uest for contiguous space C! -236 ; ,e&uest for large area of contiguous space H! ,'?4$ ; ,e&uest for entire cylinder for storage of data set 3n this e"ample, 39 cylinders are re&uested as primary space and B additional cylinders as secondary space! ?p to 1@ e"tents of secondary space can be allocated! /o compute total space, formula isG /otal 7pace . #1 J primary) N #1@ J secondary)

$C( )arameterG /he $ata Control (loc0 #DCB) parameter is used to specify record format #REC. ), record length #LRECL) and bloc0 si=e #BL#SI=E! ,ecord <ormat #,1C<-) can beG 1! <i"ed #<) %! <i"ed;(loc0 #<() 3! Eariable #E) B! Eariable;(loc0 #E() @! ?ndefined length #?) ,ecord Length #L,1CL) specifies the length of the record! L,1CL can range from 1 to 3%HC9 bytes!

When you specified E for ,1C<- parameter, L,1CL *alue is largest record in the file plus B bytes! /hese four bytes contain the actual length of each *ariable length record in the file $epending on the record format, record length *aries as followsG 1! 1&ual to the record length for fi"ed;length records %! 1&ual to the si=e of the largest record plus the B bytes describing the record:s si=e for *ariable;length records 3! 'mit the L,1CL for undefined records! (loc0 7i=e #(L573D1) specifies the bloc0 si=e if you wish to bloc0 records! 3t must follow the following rulesG 1! must be a multiple of L,1CL for fi"ed;length records %! must be e&ual to or greater than L,1CL for *ariable;length records 3! must be as large as the longest bloc0 for undefined;length records B! (L573D1 can range from 1 to 3%HC9 bytes ?se (L'C5 C'4/+347 9 ,1C',$7 in your <$ #and (L573D1.9 in your JCL $C( parameters) to allow the '783A9 operating system to optimi=e your bloc0 si=e! /hese two changes ensure that the ma"imum number of records will be processed for a single file input8output operation! <or an output dataset, if (L'C573D1 is omitted from the <$ section of the program or if (L'C5 C'4/+347 9 is specified, it will get the (L'C573D1 defined in the $$ parameters #i!e! $C() or dataset label of the file from the JCL!! 3tOs always better to write (L'C5 C'4/+347 9 ,1C',$7 8 C>+,+C/1,7 in C'('L program so that you can specify the (L573D1 in JCL! 7uppose there is a re&uirement to change the (L573D1 due to change in L,1CL this will cause only change in (L573D1 in JCL! 3f you mention (L'C5 contains 4 records in C'('L program, then it is re&uired to match with (L573D1 in JCL also it would be re&uired to change C'('L N JCL both! 3f you code (L573D1.9 in your $C(, the system will determine the most efficient bloc0 si=e for space utili=ation!

@) What is the difference between 7e&uential $ataset and )artitioned $ataset? +ny named collection of data is called a data set! + partitioned dataset consists of multiple files within one data structure! + se&uential dataset consists of one file within a data structure! + partitioned dataset differs from a se&uential dataset in that it has a directory of its members! Whene*er you refer to a member of a partitioned dataset, you include the member name in parentheses! )artitioned $ataset 1! %! 3! B! indi*idual members are read8manipulated without disturbing other members it is ad*isable to ne*er write directly to a partitioned dataset in your program on $$ statememtG $74.userid!file#member) call from editorG file#member)

7e&uential $ataset

1! dataset must be read from top to bottom %! on $$ statementG $74.userid!file 3! call from editorG file )+,/3/3'41$ $+/+71/ $74.:userid!data;set; name#member): 71M?14/3+L $+/+71/ $74.:userid!data;set;name:

______________ | DIRECTORY | |--------------------| | MEMBER1 | |--------------------| | MEMBER2 | |--------------------| | ....... | |--------------------| | MEMBERn |
|------------------------| |________________|

______________ | | | | | | | DATASET | | | | | | | | | | |
|_______________|

C) What are 3nstream and Cataloged )rocedures? 3n JCL, we ha*e important concept reusability in the form of 3nstream and Cataloged procedures, 'ften, in wor0 en*ironments users can utili=e same JCL! ?sing instream 8 cataloged procedures we can reuse the JCL code which was stored in another data set, in our data set! 7ynta" for e"ecuting procedure 88-I),'C 121C ),'C.347),'C

3nstream )rocedure o + JCL )rocedure is a pre;written segment of code that you can include in your J'(! Iou code instream data set within the job and use it in that job as many times as you want! o 3nstream procedure should be defined, before any 121C statement defined! o 3nstream procedure starts with ),'C and ends with )14$ statements! o 3nstream procedure is e"ecuted when the main JCL is called! o /he ma"imum number of instream procedures you can in any job is 1@! +n 3nstream )rocedure JCL 1"ampleG //TJD2B000 JOB (001,BRP,PROD),'PFI0000R',CLASS=2, // MSGCLASS=R /*JOBPARM SYSAFF=BSWB //* //PFI0000R PROC OUTN='*', // LIB='T ST', FOR T STING US '!A' // SYST M=DB2T, FOR T STING US 'DB2!' // UID='PFI0000R' //****************************************************

//*** ST P010 " DSNUTIL " (!UI SC TABL ) //**************************************************** //ST P010 # C PGM=DSNUTILB,COND=($,LT),R GION=%M, // PARM=(&SYST M,&UID) //ST PLIB DD DSN=SYSD'DB2'&LIB''DSN #IT,DISP=S(R // DD DSN=SYSD'DB2'&LIB''DSNLOAD,DISP=S(R //SYSPRINT DD SYSOUT=&OUTN //UTPRINT DD SYSOUT=&OUTN //SYSIN DD DSN=TBSC'T ST'JCLLIB(FI000C01),DISP=S(R //**************************************************** //* // P ND //* //PFI0000R # C PFI0000R // //****************************************************

/he following is an e"ample of an instream ),'C that is used three times when the J'( is e"ecuted! /he job step that calls the instream ),'C will pro*ide the name of the )$7 to be created *ia the $74+-1 substitution *alue!

//PDSCRTJ$ JOB SIMOTIM ,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* T)* JCL +*+,*- *.*/01*2 1)* 3421-*5+ PROC /566*7 PDSCRTP8 547 //* 9522*2 5 :066; <0563:3*7 7515 2*1 45+* (DSN) =35 1)* 2;+,o63/ 45+* //* /566*7 DSNAM 547 -*:*-*4/*7 34 1)* PROC 52 &DSNAM ' //* //********************************************************************* //* T)* 3421-*5+ PROC :o- /-*5134> 5 PDS' T)* D515 S*1 N5+* (&DSNAM ) //* 32 9-o=37*7 ,; 1)* ?o, 21*9 1)51 /5662 1)* PROC' //* //PDSCRTP3 PROC //PDSCRTS1 # C PGM=I FBR1$ //T MPLIB1 DD DISP=(N W,CATLG),DSN=&DSNAM , // STORCLAS=MFI, // SPAC =(TR@,($A,1A,A0)), // DCB=(R CFM=FB,LR CL=B0,BL@SIC =B00,DSORG=PO) // PEND //* //* ******************************************************************* //* S1*9 1 o: 8 C-*51* 5 PDS 0234> S T 547 # C //* // S T DSNAM =SIMOTIM 'D MO'T MP01 //ST PJ$1 # C PDSCRTP8 //* //* ******************************************************************* //* S1*9 2 o: 8 C-*51* 5 PDS 0234> # C 547 DSNAM 20,2131013o4 //* //ST PJ$2 # C PDSCRTP8,DSNAM =SIMOTIM 'D MO'T MP02 //* //* ******************************************************************* //* S1*9 8 o: 8 C-*51* 5 PDS 0234> # C 547 DSNAM 20,2131013o4 //* //ST PJ$8 # C PDSCRTP8,DSNAM =SIMOTIM 'D MO'T MP08 //*

Cataloged )rocedures

o o

)re;written segment of code #which is stored as a member of )$7), which you can use as many times you want in any job in the system! 3(- supplies a utility program called 31(?)$/1P this program places cataloged procedures into partitioned data sets! /hese procedures are placed inside a system library called 7I71!),'CL3(! When you e"ecuting C+/+L'61$ ),'C1$?,1, 3f you not specified where it is with JCLL3( statement, it will search for this procedure in system procedure library 7I71!),'CL3( 7teps in $e*eloping Catalog )rocedure 7tep1G Write an Cataloged procedure in -IL3(!12+-)L17!/17/#C+/+L'61) //CATLOG1 //ST P1 //INFIL // //OUTFIL // PROC # C DD DD PGM=COBPROG DSN=T ST'GLOB'LIB, DISP=S(R DSN=T ST'GLOB'SPAC 'LIB, DISP=S(R

Write -ain JCL which will call out C+/L'61 JCL //MYJOB // //ST P1 // JOB JCLLIB # C (W 28$),'RAM S(',CLASS=A ORD R=(MYLIB' #AMPL S'T ST) CATALOG1

H) >ow does o*erride wor0 on a JCL? /here are times, when we want to change procedure statements according to our re&uirement, 3(- pro*ided a way without changing actual procedure, we can add8modify contents of procedure! /here are two types of modificationsG on 121C statement on $$ statement 'n 121C statement, we can do following functions on 121C statement in a procedureG -odify parameter on 121C statements PROC DUR STAT M NTD //ST P10 # C PGM=COBPROG,TIM =80 PARAM T R OE RRID D //MYST P # C PROC=MYPROC,TIM 'ST P10=$0 4ow ,esultant /3-1 *alue for that step #in proc) is B9 +dding parameter to an 121C statement 8 all 121C statement PROC DUR STAT M NTD //ST P10 # C PGM=COBPROG,TIM =80 PARAM T R ADDINGD

//MYST P # C PROC=MYPROC,R GION'ST P10=A%@ (:o- 234>6* 21*9) ,163'4 will be added to the 7/1)19 in -I),'C procedure PARAM T R ADDINGD //MYST P # C PROC=MYPROC,R GION=A%@ (:o- 234>6* 21*9) 3f ,163'4 is not a*ailable for any step in that procedure, ,163'4 will be added to all steps in procedure! 3f ,163'4 is a*ailable for any step in procedure, ,163'4 *alue will be o*erride e"isting *alue on that step! 4ullifying the parameter *alue PROC DUR STAT M NTD //ST P10 # C PGM=COBPROG,TIM =80 PARAM T R ADDINGD //MYST P # C PROC=MYPROC,TIM 'ST P10= $onOt gi*e any *alue for that parameter, it will nullifying that parameter *alue in procedure! 'n $$ statementG 7ynta" for add8modify $$ statements in a procedure # C DD FPROC=G9-o/*70-*"45+* 95-5+*1*-==560*

//45+* //F9-o/21*945+*G'7745+* //

We can do following functions on 121C statement in a procedure using abo*e synta"! -odify e"isting parameter on $$ statements within a procedure +dd parameter to e"isting $$ statement within a procedure +dd $$ statement to a job step 4ullify the effect of parameter on $$ statement in a procedure!

L) >ow do you concatenate datasets in the JCL? 3t is possible to process more than one data set as a single data set by concatenating the $$ statements! 88M7+-99L9 $$ $74.73-'/3-1!$+/+!<3L19991,$37).7>, 88 $$ $74.73-'/3-1!$+/+!<3L1999%,$37).7>, 88 $$ $74.73-'/3-1!$+/+!<3L19993,$37).7>, /he following is an e"ample of a C'('L 71L1C/ statement! 71L1C/ M7+-99L9;<3L1 +77364 to M7+-99L9 ',6+43D+/3'4 is 71M?14/3+L +CC177 -'$1 is 71M?14/3+L

<3L1 7/+/?7 is M7+-99L9;7/+/?7! 3n the preceding e"ample the C'('L program will read M7+-99L9 and the $$ statements will map the three files #<3L19991, <3L1999% and <3L19993) as one file! /he program:s initial read will get the first record from <3L19991 and will not get an 1nd;of;<ile condition until the last record of <3L19993 is processed! A) >ow do you do a refer bac0 to a pre*iously defined dataset? 3n multi;step jobs, a later step can use a referbac0 instead of specifying in full a file which has already been specified in an earlier step! <or e"ample in this procedure //MYPROC '''''''''''''''' //MYPR01 # C PGM='''''''''' //N WFIL DD DSN=&MYFIL ,UNIT=DIS@,SPAC =(TR@,A0,10), // DCB=(LR CL=100,BL@SIC =1000),DISP=(N W,CATLG,D L T ) '''' //MYPR02 # C PGM='''''''''' //INPUT01 DD DSN=*'MYPR01'N WFIL 4oteG step -I),9% uses the file identified as 41W<3L1 in step -I),91 #$74 means Kdataset nameK and specifies the name of the file)! 3n jobs which contain a mi"ture of job;specific JCL and procedure calls, a job;specific step can refer bac0 to a file which was fully specified in a procedure, for e"ample //MYJOB JOB '''''''''' //ST P01 # C MYPROC U234> 5 9-o/*70-* //ST P02 # C PGM=''''''''S1*9 H)3/) 32 29*/3:3/ 1o 1)32 ?o, //INPUT01 DD DSN=*'ST P01'MYPR01'N WFIL where $74.7/1)91!-I),91!41W<3L1 means Kuse the file identified as 41W<3L1 in step -I),91 of the procedure used by step 7/1)91 of this jobK! ?sing the name of the step which called the procedure rather than the name of the procedure allows a programmer to use the same procedure se*eral times in the same job without confusion about which instance of the procedure is used in the referbac0! 19) What are symbolic parameters? ?sually, the same JCL can be used by different programmers to implement common tas0s, such as the opening, reading, and writing of data sets! 3n those cases, we can use symbolic parameters! ?sing symbolic parameters we can pass *alue to a parameter which is used in procedure! + symbolic parameter on a $$ statement is coded the parameter preceded by an ampersand! 12+-)L1 JCL ;F )rocedure which is using symbolic parameter //MYPROC //MYST P //INFIL //OUTFIL // // PROC # C DD DD

PGM=COBPROG DSN=&DOC''T ST'LIB,DISP=S(R DSN=&DOC''T ST'OUT, DISP=(N W,@ P,D L T ), UNIT=SYSDA,

// T)* 34=oI34> //ST PA1 # C

SPAC =(CYL,(&SPAC )) # C 2151*+*41 MYPROC,DOC=MYLIB,SPAC ='10,A'

T)* *::*/13=* JCL //MYPROC //MYST P //INFIL //OUTFIL // // // 12)L+4+/3'4 ; o o 3n abo*e e"ample, $'C, 7)+C1 are symbolic parameters in -I),'C procedure! We are passing *alues from in*o0ing JCL, these *alue will be o*erride the $'C and 7)+C1 where e*er they find in the procedure PROC # C DD DD PGM=COBPROG DSN=MYLIB'T ST'LIB,DISP=S(R DSN=MYLIB'T ST'OUT, DISP=(N W,@ P,D L T ), UNIT=SYSDA, SPAC =(CYL,('10,A'))

11) What is a 6$6 #6eneration $ata 6roup)? 6eneration $ata 6roups or 6$6Os are a group of data sets which are related to each other chronologically and functionally! /hese related $ata 7ets share a uni&ue $ata 7et 4ame! 1*ery 6$6 data set has a 6eneration number and Eersion number assigned to each data set! EXA PLE ;; :-IL3(!L3(!/17/!69991E99: :-IL3(!L3(!/17/!6999%E99: :-IL3(!L3(!/17/!69993E99:

Q;; Current Eersion

6eneration 4umber ;F 6aaaaEnn aaaa is between 9999 to AAAA nn is between 99 to AA 3n JCLG We refer current *ersion with 9 1"ample! -IL3(!L3(!/17/#9) 4ew *ersion going to create with N1 1"ample! -IL3(!L3(!/17/#N1) 'lder *ersions , refer with ;1 ;% ;3 etc!!!! 1"ample! -IL3(!L3(!/17/#;1) Q; 'L$1, E1,73'4 1"ample for where we can use this 6$6sG ?sually, 3n production en*ironment, for e*ery month we need to run jobs to create reports for that month!

Let us suppose

for J+4, We can code it for <1(, We can code it for -+,, We can code it

7LIB%LIB%TEST%JAN 7LIB%LIB%TEST%.EB 7LIB%LIB%TEST% AR

7o, e*ery month we need change dataset name in JCL, before submitting the job! Whene*er we entered into another year, we need to delete old yearOs data sets! We need to do abo*e tas0 carefully, 3f we use 6$6, 3t will ta0e care following things o o o o 3t will maintain all generation of data sets 3t will delete8uncatalog older generation Eery easily, we can refer current and older *ersions of data sets 4o need of change the JCL e*ery time when we submit

(efore using 6$6, we need to create 6$6 inde" and model! >ow do you create a 6$6 inde"? o o 3$C+-7 #the :+-7: stands for +ccess -ethod 7er*ices), utility is used to create 6$6 inde"! 1"ample JCL for creating 6$6 inde"! 88-IJ'( J'( #W%3B),O-I4+-1O 887/1)1 121C )6-.3$C+-7 887I734 $$ J $1<341 6$6#4+-1#-IL3(!L3(!/17/) L3-3/#19) ; 4'1-)/I ; 7C,+/C>) 8J 88

3n this e"ample, 3$C+-7 utility is used to create an inde" for a 6$6 called -IL3(!L3(!/17/! /he number of generations that can e"ist in this 6$6 is limited to ten! 4'1-)/I parameter is used to specify , 'nce the limit is reached, the system is instructed to un;catalog the oldest generation data set within the 6$6! 7C,+/C> parameter is used to specify to physically delete the data set which was un;catalogued! )arameters we can pass to 3$C+-7! o 4+-1G /his parameter is used to specify the name of the data set that is to be created! o L3-3/G /his parameter is used to specify the total number of generations that the 6$6 may contain! o 1-)/I84'1-)/IG /hese two parameters are mutually e"clusi*e! 1-)/I specifies that all e"isting generations of the 6$6 are to be un;catalogued whene*er the generations of 6$6 reached the ma"imum limit! 4'1-)/I specifies that only the oldest generation of the 6$6 is to be un;catalogued if the limit is reached!

o 7C,+/C>84'7C,+/C>G /hese two parameters are mutually e"clusi*e! 7C,+/C> parameter specifies that whene*er entry of the 6$6 is remo*ed from the inde", it should be deleted physically and catalogued! 4'7C,+/C> parameter specifies that whene*er entry of the 6$6 is remo*ed from the inde", it should be catalogued, not physically deleted! 4oteG 7C,+/C> and 4'1-)/I are default parameters! 'nce the inde" has been created, a model data set must be created! /his model data set contains specifications for the $C( sub;parameters for all data sets that will belong to that 6$6! )rogrammer can o*erride this default *alues if he want! EXA PLE JCL 88-IJ'( J'( #WAL3),:5,37>4+: 887/1)1 121C )6-.3$C+-7 887I734 $$ J $1<341 6$6# ; 4+-1#-IL3(!L3(!/17/) ; L3-3/#19) ; 4'1-)/I ; 7C,+/C>) 887/1)% 121C )6-.31<(,1B 88-'$1L1 $$ $74.-IL3(!L3(!/17/, 88 $37).#41W,511),$1L1/1), 88 ?43/.7I7$+, 88 7)+C1#/,5,9), 88 $C(.#L,1CL.L9,,1C<-.<(,(L573D1.L99) 88 ?sing 31<(,1B, we ha*e created the model! /o use created 6$6 in our JCL, we need to use name #with N1 for new generation) which we used in $1<341 6$6 command! #i!e! -IL3(!L3(!/17/)! EXA PLE JCL 88-IJ'( J'( #7$3B@),O-I4+-1: 887/1)1 121C )6-.C'(),'6 8834<3L1 $$ $74.-IL3(!L3(!/17/#N1), 88 $37).#41W,C+/L6,$1L1/1), 88 ?43/.7I7$+, 88 7)+C1.#/,5,#%9,19),,L71), 88 $C(.#-'$1L!$C(,,1C<-.<(, 88 L,1CL.L9, 88 (L573D1.L99) 88 /he program C'(),'6 is e"ecuted! + new generation data set is created *ia the statement 8834<3L1 $$ $74.-IL3(!L3(!/17/#N1) 7ince we used #N1) with 6$6 name, it creates a new generation

data set! /he $37) parameter must be set to C+/L6 for all new generation data sets , $37).#41W,C+/L6,$1L1/1) We used -'$1L!$C( in $C( parameter to instruct system to use 7ub;parameters specified in model 6$6! 4oteG /he $74 and ?43/ parameters must be coded for all new generation data sets! 3n my JCL, 3n step1 3 will going to create a new generation data set for that 3 ga*e 6$64+-1#N1)! 3n step%, 3 want to use same data set created by pre*ious step? What number 3 should gi*e to refer that data set #i!e! 9 or N1 or N%)? #7/1)1 121C?/1$ 7?CC177<?LLI)! Why? o ?se number N1 to refer to the dataset created by the pre*ious step! 1*en step1 e"ecuted successfully, it is not become the current generation of 6$6! +t the end of the job only it will become the current *ersion of 6$6! 7o within the job we need to refer it as new generation only, e*en that step completed successfully!

You might also like