part 2 -JCL

download part 2 -JCL

of 33

Transcript of part 2 -JCL

  • 8/21/2019 part 2 -JCL

    1/33

    1

    JCL

    Any business application is divided into logical modules and these modules are developedusing programming languages. These programs should be executed in a pre-defined

    sequence to achieve the business functionality.

    JCL (Job Control Language is used to !"#$%" and C&%T'&L the J& to the operatingsystem.

    !efinition involves definition of  the programs need to be executed) the data for the

    programs and the sequence of programs. C&%T'&L involves controlling the execution orbypassing of a program in the sequence based on the result of the prior program execution.

    JCL Coding *heet

    + , ++ + / 01%A2" &3"'AT$&% &3"'A%!*

    JCL statements should have 44 in column + and ,. *TA' (565 in the third column) indicatesthat the line is a comment line.

    %A2" is optional field. $f coded) it should start at column and can have maximum 0

    characters. The first character should be an alphabet or national character (7) 8 or 9.'emaining characters can be any alphanumeric or national characters.

    &3"'AT$&% follo:s %A2" field. There should be at least one space bet:een %A2" and

    &3"'AT$&%. $f %A2" is not coded then &3"'AT$&% can start at fourth column itself. Typical&3"'AT$&% ;ey:ords are J&) "

  • 8/21/2019 part 2 -JCL

    2/33

    2

    Job "ntry *ubsystem (J"*

    Job "ntry *ubsystem (J"* is the ob processor of 2B* operating system.2B* installation can have either J"*, or J"*. The submitted obs are ta;en by J"* for

    processing.

    J"*, J"*!ecentralied "nvironment. "veryprocessor processes the incoming obs

    individually.

    Centralied "nvironment. There is aglobal processor that controls all the

    other processors and assigns the obs to

    them.

    !atasets are allocated before the step

    execution.

    !atasets are allocated before the ob

    execution.

    JCL *tatements

    J&. $t should be the first statement in the JCL. $t indicates accounting information and

    J& related information to the system. $f the member being submitted contains multiple ob

    cards) then multiple obs :ill be submitted. These obs :ill run concurrently or one afterother based on ob name) class and initiator availability.

    "

  • 8/21/2019 part 2 -JCL

    3/33

    3

    @ser A"%!(@nnnnE Hhen some unexpected condition occurs in the data passed) theprogram :ill call an abend routine and abend the step :ith proper displays. This is thro:n

    by application based on the requirement.

    JOB Statement

    *ample *yntaxE

     44J&%A2" J& (ACC&@%T$%F $%#&) (3'&F'A22"' %A2") 44 T$2"I(2$%@T"*)*"C&%!*) CLA**IA)2*FCLA**IA)3'TI+>)A!!'IB$'T)

     44 '"F$&%InK)2*FL"B"LI(A))C&%!I(%)&3"'AT&') T3'@%I*CA% JOBNAME

    $t identifies name of the ob. The ob is identified in the J"* *3&&L using this name.

    %aming rules are already mentioned in the coding sheet section.

    ACC&@%T$%F $%#& (2andatory. $nstallation !ependant.

    +. 'esource usage charges are charged to the account mentioned here.,. $f you don=t ;no: your installation account) you cannot submit the ob. $t is li;e :hen

    you don=t have account) you cannot :ithdra: cash in ban;.. 2aximum +>, characters can be coded as accounting information.

    PROGRAMMER NAME

    3rogrammer name or program functionality or group can be mentioned. $t is used for

    documentation (2ax ,1 chars

    CLASS (n!tallat"on De#"ned)

    +. CLA** is coded :ith single alphanumeric character (A-G) 1-.

    ,. !uring installation) every CLA** and its properties are defined.. !efinition describes the ob characteristics li;e C3@ time usage) number of tape4cart

    usage and other resource constraints.

    >. "very class is assigned to one or more initiators. The obs run in initiator address space.&ne initiator can process one ob at one time.

    PR$%

    *yntaxE 3'TI% (% can be 1 ?+D.+. Hhile selecting the obs :ith same class for execution) J"* schedules the high priority

     obs first. The ob coded :ith 3'TI+D has the highest priority and 3'TI1 has the

    lo:est priority.,. 3'T :or;s :ithin the J&CLA**. $f there are , obs :ith CLA** A is submitted and one

    :ith 3'T and other :ith 3'T > then 3'T > :ill get into execution queue first.

    . 3'T function is disabled in most of the installations.

    MSGLEEL

    *yntaxE 2*FL"B"LI(

  • 8/21/2019 part 2 -JCL

    4/33

    '

    MSGCLASS (n!tallat"on De#"ned)

    *yntaxE 2*FCLA**I< (< can be A-G) 1-.+. 2*FCLA** is coded :ith single alphanumeric character (A-G) 1-.

    ,. "ach 2*FCLA** is mapped to a device or location) :here the messages are routed.

    ADDRSPC

    $t is used to specify :hether the ob :ill run in the 'eal storage or Birtual storage.

    *yntaxE A!!'*3CIN'"ALOB$'TP

    '"AL ? Allocation is done in '"AL storage and the program is not page-able.B$'T ? Allocation is done in B$'T@AL storage and the program is page-able.

    REGON

    *yntaxE '"F$&%INxK O y2P (x can be +-,1+,0 M y can be +-,1>/.

    +. $t is used to specify the amount of central 4virtual storage the ob requires.$t can be requested in the units of ;ilobytes (xK or megabytes (y2. $f requested in

    terms of ;ilobytes) then x should be multiple of > or the system :ill round it to nearest

    >K allocates for your ob.,. '"F$&% can be coded in ". 'egionI12 allocate all the available memory in the address space to this ob.

    D. 'egion related A"%!*E Hhen the requested region is not available) the J& :ill A"%!:ith *0,,. Hhen the requested region is not enough for the program to run) you :ill get

    A"%! *01A or *01>.

    RES$AR$

    '"*TA'T parameter allo:s restarting from any particular step in the ob.*yntaxE '"*TA'T I *tep-name in the ob

    '"*TA'T I 6 means restart from the beginning.To restart from any procedure steps) code '"*TA'TI3'&C*T"3.*T"3%A2"

    Hhereas 3'&C*T"3Iname of the JCL step that invo;ed the 3'&C M

    *T"3%A2"Iname of the proc step :here you :ant execution to start.'"*TA'T ignores any condition in the step being restarted and it can also be stepthat is in the "L*" part of the $#.."L*".."%!$#.

    $%PRN

    $t is used to request special ob processing.

    +. T3'@%I*CA% chec;s the syntax errors :ithout actual execution.,. T3'@%IQ&L! chec;s the syntax error and if there is any error) it is notified and if there

    are no errors) the ob is ;ept in a:aiting execution queue and it should be released byuser for execution. 'elease can be done by typing 5A= against the ob name in *!*#.

    . T3'@%IJCLQ&L! #unction is same as Q&L! but the syntax chec; starts only after therelease of the ob.

  • 8/21/2019 part 2 -JCL

    5/33

    $ME

    $t defines the maximum allo:able C3@ time for the J&. The parameter can be coded at"

  • 8/21/2019 part 2 -JCL

    6/33

    ,

     

    PARM

    +. $t is used to pass variable information to the processing program) executed by this obstep.

    ,. $f there is more than one sub parameter or if there is any special character then enclose

    them in parentheses4quotes.

    . 2aximum +11 characters can be passed in this :ay. Suotes and brac;ets are notincluded in this +11.To pass a quote to the program) indicate that :ith t:o quotes one

    follo:ed by other.>. The program can receive them using lin;age section. Lin;age section must be coded :ith

    half :ord binary field as first field. This field is populated :ith length of the 3A'2 passedfrom the JCL.

    "xampleE 44*T"3 "

  • 8/21/2019 part 2 -JCL

    7/33

    0

    The mapping is done as follo:s in the program. *o in future) if you process the sameprogram :ith another file *2*

  • 8/21/2019 part 2 -JCL

    8/33

    !C (!ata Control loc; !C specifies attributes of the records in the dataset.

    *yntax !CI(L'"CLI%%)LK*$G"I)'"C#2IG)!*&'FI22)@#%&Inn

    '"C#2$t specifies format of the dataset. $t can be #ixed) Bariable) @ndefined) #ixed loc;ed)

    variable loc;ed. (#) B) @) #) B. &ther special record formats are B*) #*) BT) #T) #A.

    L'"CL$t specifies logical record length. The length of the record is as in the program for

    fixed length records) length of the longest record :ith four more bytes for variable lengthrecords.

    LK*$G"

    $t contains physical record length. That is the length of the record in the storagemedium. &ne bloc; contains one or more logical records. $t is suggested to code LK*$G"

    as 1 so that the best sie is chosen by the system) based on device.

    $f you explicitly code it) then it should multiple of L'"CL for # datasets and shouldnot be less than length of the longest records :ith eight more bytes for B dataset. $n the

    extra eight bytes) four bytes are used for length of the record and four bytes are used forlength of the bloc;.

    !*&'F. 3* (3hysical sequential 3& (3artitioned organiation

    @#%&.

    The number of buffers to be allocated for the dataset is coded :ith @#%&parameter. 2aximum of ,DD buffers can be coded. The performance of sequential

    processing :ill increase if more buffers are allocated. The default buffers are enough formost of the cases.

    *ource of !CEHe don=t al:ays have to :rite the !C parameter for a dataset. Hriting !Cparameter is one of the three :ays) the information can be supplied. The other t:o :ays

    areE

    +. Coded in the program. $n C&&L) '"C&'! C&%TA$%* clause specifies the L'"CL) L&CKC&%TA$%* clause specifies the LK*$G") '"C&'!$%F 2&!" clause specifies '"C#2 and

    '"*"'B" clause specifies @#%&. !*&'F can be assumed from the name of the datasetand the directory space allocation of *3AC" parameter.

    ,. @sually for an existing dataset) :e don=t have to code !C parameters. $t :ill be

    available in the dataset label. The dataset label is STORED in the BT&C (!A*! or along

    :ith dataset (TA3" during the dataset creation.

    LA"L

    *yntaxE LA"L I (!ataset-sequence-number  )label-type

      )3A**H&'! O %&3H'"A!  )$% O &@T

      )'"T3!Innn O"

  • 8/21/2019 part 2 -JCL

    9/33

    Dataset Se#uence number - identifies the relative position of a dataset on a tape4cartvolume. *hould be + through > decimal digits. &mit this parameter if access is being made

    to the first dataset on the tape volume.

    Label  - indicates the label type of the tape4cart volume.*L - indicates that a dataset has $2 standard labels. !efault value.

     %L - indicates that a tape dataset has no labels. %*L - indicates that a tape dataset has nonstandard labels.

     *@L - indicates that a tape dataset has both $2 standard and user labels. L3 - requests that the system bypass label processing for a tape dataset.

     PASSW$%D - indicates that a dataset cannot be read) changed) deleted or :ritten to unless

    the correct pass:ord is specified. N$PW%EAD - indicates that a dataset cannot be changed) deleted or :ritten) unless the

    correct pass:ord is specified. %o pass:ord is necessary for reading the dataset.

    IN  - indicates that a dataset opened for $4& is to be read only.

     $&  - indicates that a dataset opened for $4& is to be :ritten only.

     %EPD ' EPD  - indicates the retention period and the expiration date for a dataset. "xE LA"LI"+,+ (!ataset expires on +,+st day of ,11>

      LA"LI'"T3!I,11 (!ataset is retained for ,11 days

    SPACE

    $t is used to request space for the ne: dataset. $t is mandatory for all the %"Hdatasets.

    *3AC" I (NT'K O CL O bl;lgthP ()3rimary-qty ) *econd-qty) !irectory

      X)'L*"Y X)C&%T$FY X)2

  • 8/21/2019 part 2 -JCL

    10/33

    1

    %LSE - requests that space allocated to an output dataset) but not used) is to be released:hen the dataset is closed. 'elease occurs only if dataset is open for output and the last

    operation :as a :rite.

    C$NI1 - requests that space allocated to the dataset must be contiguous. $t affects onlyprimary space allocation.

    MII1 ? $t is used to specify that space requested should be allocated to the largest

    contiguous area of space available on the volume. $t affects only primary allocation.

    %$&ND - Hhen the first parameter specifies the average bloc; length) this parameterrequests that allocated space must be equal to an integral number of cylinders. "lse

    ignored.

    E4tent!"xtent is contiguous memory location. &nly + extents are possible for a physical

    sequential dataset in a volume. $n loose terms) only + pointers can be stored for a 3*dataset in one volume. #or a B*A2 dataset it can be +,. $n addition to this) the primary

    (first or secondary (consecutive space request has to be met :ithin D extents.$f any of the above is not met) then there :ill be space A"%!. *o for a 3* dataset)

    even though you request +11 trac;s (using the space parameter (*3AC"IT'K*)(+11)+11) the system may not allocate you +11 trac;s al:ays.

    $f all the contiguous available spaces are of sie ,1 trac;s) then D extents are usedfor satisfying every primary or secondary. *o +D extents are used for providing ust 11

    trac;s. $f the system could find any +11 trac;s for the + th extent) it :ould offer it and if

    not) there :ill be space A"%!. *o in the best case you :ill get +11 trac;s and in the:orst case you :ill get >11 trac;s for the space parameter mentioned.

    *pace A"%!*EThe most frequent A"%! in any production system is space abend.

    */E "nd of volume. $f the program tries to :rite more than the allocated space or if the

    system could not find the requested primary or secondary space even by oining D extents)then the step abnormally ends :ith */.

    To solve this abend) increase the primary4secondary reasonably and if the ob againcomes do:n) create the dataset as multi-volume by coding B&LI())). As every volume :ill

    offer + extents) >0 extents in this case should be more than enough.

    *!/E $f the primary space is filled and the program tries to :rite more but no secondary ismentioned in the *3AC" parameter) then the step :ill come do:n :ith *!/.To solve this

    abend) provide secondary allocation in the *3AC" parameter.

    *"/E "nd of Bolume. This is same as */. ou :ill get this A"%! usually for a

    partitioned dataset. To solve this) compress the 3!* by typing 5G= in $*3# .> panel againstthe dataset or use $"F"%"'. $f again the ob comes do:n) rename the old one) reallocatethe ne: dataset :ith more space and copy the old members to here and delete the

    renamed dataset and restart the ob.

  • 8/21/2019 part 2 -JCL

    11/33

    11

    N$

    $t is used to request the system to place the dataset on a specific device4a certaintype or group of devices or the same device as another dataset.

    @%$TI((device-number O device-type O group-name  ()unit-count O 3

      ()!"#"'

      &' @%$TIA##Iddname

    0e2ice-number  - identifies a particular device by a -character hexadecimal number.$t should not be used unless absolutely necessary.

    0e2ice-t/3e - 'equests a device by its $2 supplied generic name. ("g. 01

    rou3-name  - 'equests a group of devices by its symbolic name. $nstallation must have

    assigned the name to the device(s during system initialiation.The group-name is + through 0 alphanumeric characters ("g. T"23!A

    unit-count  - *pecifies the number of devices for the dataset. (+-D

    P - as;s the system to mount all volumes for a dataset in parallel.

    DEFE%  - As;s the system to assign the dataset to the device but requests that thevolume(s not be mounted until the dataset is opened. !"#"' is ignored for a ne: dataset

    on direct access.

     AFF=00name - 'equests that system to allocate different datasets residing on different

    removable volumes to the same device during step execution. The ddname is that of anearlier !! statement in the same step. $t reduces number of devices used in a ob step.

    "xE @%$TI(TA3"))!"#"' @%$TIA##I!!+

    OLME

    A reel of TA3" or a dis; pac; is called as one volume. B&L@2" parameter is used to

    identify the volume(s on :hich a dataset resides or :ill reside.B&L@2" I ((3'$BAT"

      ()'"TA$%  ()volume-sequence-number

      ()volume-count  (*"'Iserial-number+)

      serial number,......

    P%I4AE  - 'equests a private volume) that is exclusive use of volume for the datasetspecified. &nly one ob can access it at a time. TA3"* are 3'$BAT" by default.

     %EAIN  - 'equests that volume is not to be demounted or re:ound after the dataset is

    closed or at the end of this step. $t is used :hen a follo:ing step is to use the same volume.

    2olume-se#uence-number  - identifies the volume of an existing multi volume datasetto be used to begin processing the dataset. (+-,DD

    2olume-count  - *pecifies the maximum number of volumes that an output dataset requires.

    (+-,DD

  • 8/21/2019 part 2 -JCL

    12/33

    12

    SE%=serial-number  - $dentifies by serial number the volume(s on :hich the dataset resides

    or :ill reside. + through alphanumeric or national(7)8)9 characters.ou can code a maximum of ,DD volume serials.

    "x E B&L@2"I*"'I!"B11+ B&LI())))*"'I(3AF"1+)3AF"1,)3AF"1

    S%SO$56la!! 7 8$t is used to identify this dataset as a system output dataset. The **&@T dataset is

    assigned to an output class. The attributes for each class are defined during J"*

    initialiation) including device or devices for the output class. =6= refer-bac;s to 2*FCLA**character of J& CA'!.

    Po!"t"onal and 9e:;ord Parameter!

    All the parameters of J&) !! and "

  • 8/21/2019 part 2 -JCL

    13/33

    13

    O$LM

    $t limits the number of print lines. The limit ranges from + to +///,+D. The ob isterminated if the limit is reached.

     44name !! **&@TI6)&@TL$2I111$f the program tries to :rite 11+st line) J& :ill A"%! :ith */,,.

    DES$

    The !"*T parameter is used in conunction :ith the **&@T parameter :here the

    output is to be sent. This might be used :here a ob is run on several 2B* systems and theoutput is directed to a single system for the convenience of the end-user.

    *yntaxE 44name !! **&@TI6)!"*TIdestination-$!

    O$P$

    &@T3@T statement is used to specify **&@T parameters for several !! statements:ith a single JCL statement. $t allo:s printing the output from single !! statement several

    times) each :ith different **&@T parameters.C&3$"*) &@TL$2) CLA**) !"*T) #&'2*) F'&@3$! can be coded in &@T3@T.

     !"#A@LTI can be coded on J& and *T"3 level. *T"3 level default overrides J&L"B"L

    default.

     44T"*T8+1 J& ... 44*T"3+ "

  • 8/21/2019 part 2 -JCL

    14/33

    1'

    JCLL$ statement. $nclude must not be used to execute a 3'&C. $t is possible to nest up to+D levels of $%CL@!" statements.

    Con6atenat"on R

  • 8/21/2019 part 2 -JCL

    15/33

    1

    S=e6"al DD name!

    S$EPLB

    $t follo:s "

  • 8/21/2019 part 2 -JCL

    16/33

    1,

    Pro6ed

  • 8/21/2019 part 2 -JCL

    17/33

    10

    +. 2ultiple overrides are allo:ed but they should follo: the order. That is first you shouldoverride the parameters of step+) then step, and then step. Any overrides in the :rong

    order are $F%&'"!.,. $f the *T"3%A2" is not coded during override) then the system applies the override to

    first step alone. 44"

  • 8/21/2019 part 2 -JCL

    18/33

    1

    *2*

  • 8/21/2019 part 2 -JCL

    19/33

    1

    EBCOP%

    $t is used to copy one or more members from an existing dataset to a ne: orexisting 3!* data set. $t can be also used for compressing 3!*) Loading 3!* to TA3" and

    unloading from TA3" to dis;. This utility needs t:o :or; files **@T and **@T> inaddition to **$% and **3'$%T.

    #$"L! 2eaningC&3 #unction is C&3

    *"L"CT *pecifies the members to be copied4replaced

    *yntaxE (%A2"-$%-&@T3@T)%A2"-$%-&@T3@T)R "3LAC"-$#-"

  • 8/21/2019 part 2 -JCL

    20/33

    2

    EBGENER 

    $n addition to **$% and **3'$%T datasets) it needs **@T+ and **@T, datasets.**@T+ is coded :ith input dataset and **@T, is coded :ith output dataset. $f attributes

    :ere not given for **@T,) then the program :ould assume **@T+ attributes for **@T,.$t is primarily used as C&3 utility. $f you :ant to copy any TA3" file to !$*K or !$*K

    to TA3") then no **$% is needed.

    $f you :ant to reformat your input file or if you :ant to create members out of your3* file) then you need control card (**$% and the first statement should be F"%"'AT".

    #$"L! 2eaning

    F"%"'AT" #irst *tatement :hich sets the values for 2A

  • 8/21/2019 part 2 -JCL

    21/33

    21

     F"%"'AT" 2A1 Copied into column -,D

    Balues in column +- Convert the oned intopac;ed before copying.

    3ac;ed value is :ritten in,-1

    Balues in /1- Convert the oned intopac;ed before copying.

    3ac;ed value is :ritten in+-D

    T"*T literal is :ritten in

    column -

    E.LS$

    $t is used to list+. The entries in the catalog. (**$% K"H&'!- L$*TCTLF

    ,. !irectory(s of +-+1 3!* (**$% K"H&'!- L$*T3!*. The entries in BT&C. (**$% K"H&'!-L$*TBT&C

    Code **$%) **3'$%T and one more !! that :ill mount the volume queried in **$%.

    The follo:ing J& lists the BT&C of $%T1+ in a formatted :ay. 442J& J& CLA**IA)2*FCLA**IA)'"F$&%I,DK)2*FL"B"LI(+)+

     44L$*TBT&C "

  • 8/21/2019 part 2 -JCL

    22/33

    22

    !! statements that define the dataset) 'ecord and loc; numbers) the unequalrecords and maximum of +1 unequal records found.

    T:o 3!* are same) if the corresponding members contain same number of recordsand all the records are identical. **$% should have C&23A'" T3"I3& for 3!*.

     44**@T+ $%3@T !ATA*"T + 44**@T, $%3@T !ATA*"T ,

     44**3'$%T 44**$% !! 6

    $"T3CQ

    $""!$TE

    &ne typical intervie: question is ho: to run the selected steps. #or example) ho: to

    execute step> and step of +1 steps JCL. The typical ans:er is to restart the ob from step>

    and include a 5ALHA* T'@"= condition (li;e C&%!I(1)L" or C&%!I(>1)FT in stepsD))/)0 and +1. $f the intervie:er said C&%! should not used) then only :ay is $""!$T.

     442D,DC J& (2B*Suest)$""!$T T"*T) 44 CLA**I)2*FCLA**I

  • 8/21/2019 part 2 -JCL

    23/33

    23

    SOR$ Card to !ort t@e re6ord! ba!ed on e: #"eld!

    *&'T #$"L!*I(*TA'T3&*)L"%FTQ)T3")A*COD"*CType I CQ (Character) $ (inary) G! (Goned !ecimal) 3!(3ac;ed !ecimal)

      #* (*igned numbers

    "xE *&'T #$"L!*I(+)+1)CQ)A)+D),)CQ)ASOR$S all t@e SOR$N re6ord! ;"t@ 1/1t@ 6ol t@e 6r"ter"a

    $%CL@!" C&%!I(*TA'T3&*)L"%FTQ)T3")'&)BAL@"

    '&-'elational operator can be "S)%")LT)FT)L")F".Card to select the records :ith T'$CQ in the column >-

    $%CL@!" C&%!I (>))CQ)"S)C=T'$CQ=Card to select the records :hich has same values in ,- and D-

    $%CL@!" C&%!I (,),)CQ)"S)D),)CQ

    SOR$ 6ard to ree6t t@e re6ord! meet"n> t@e 6r"ter"a

    &2$T C&%!I(*TA'T3&*)L"%FTQ)T3")'&)BAL@"Card to reect the records :ith T'$CQ in the column >-

    &2$T C&%!I (>))CQ)"S)C=T'$CQ=Card to reect the records :hich has same values in ,- and D-

    &2$T C&%!I (,),)CQ)"S)D),)CQ

    *&'T card to change 3! to G!$f input file has a 3! field *(DB Comp- and to reformat as 3$C *(D.(, then use)

    &@T'"C #$"L!*I(+)D)3!)"!$T(*TTTTT.TT)*$F%*I()-))

    *&'T card to remove the duplicates

    *&'T #$"L!*I (+)D)CQ)A)"S@AL**@2 #$"L!*I%&%".

    *&'T$% records are sorted on the ;ey +-D and if more than one record is found tohave same ;ey) then only one record :ill be :ritten to *&'T&@T. $f "S@AL* is coded) then

    the record to be :ritten is the #$'*T record else it can be anything.

    SOR$ 6ard to ! and one record is :ritten :ithtotal sum.

    *&'T card to add sequence number to the output file

    &@T'"CI(+),1)*"S%@2)>)G!  > digit oned decimal sequence number is added

    :ith all the records of input file in column ,+-,>

      This :ill be useful for reading a file from bottom to top. This :ill be useful formatching logic in JCL. 2atching logic in JCL :ill be explained later.

    SOR$ 6ard to re!tr

  • 8/21/2019 part 2 -JCL

    24/33

    2'

    Code output files as *&'T+ and *&'T,.

    *&'T card to restructure the sorted file before :riting&@T'"C #$"L!*I(+E+),1) IZ #$'*T ,1 CQA' #'&2 $%3@T #$L"

      ,+EC=2@TQ@=) I Z #&LL&H"! *T'$%F 52@TQ@=   ,E+1G) IZ #&LL&H"! +1 $%A' G"'&*

    E,+)+1 IZ ,+*T

     to +1 CQA'ACT"'* #'&2 $%3@T #$L".

    *&'T card to change any 5et t@e !tat"!t"6! o# a net t@e n

  • 8/21/2019 part 2 -JCL

    25/33

    2

    $OOLN Card to >et all t@e alet all t@e ale ment"oned

    'A%F" #'&2($%!! &%(*TA'T)L"%FTQ)#&'2AT L$*T(&@T!! options

    &ptions are &CC@'* Q$FQ"'(n4L&H"'(n4Q$FQ"'(n+ L&H"'(n,4  "S@AL(n %&T"S@AL(n

    $t prints count of records meeting value criteria and the #&'2AT should be numeric.

    $OOLN 6ard to "noe SOR$

    *&'T #'&2($%!! T&(&@T!! @*$%F(xxxx*&'T statements should be coded under the !!%A2" xxxxC%TL

     2atching Logic in JCL

    $ have t:o files file+ and file,. $ :ant to generate three reports out of these t:o files.+.The first report should have records that exist in both files.

    ,.The second report should contain records that exist only in first file and not in second file..The third report should contain records that exist only in the second file and not in the

    first file.

     44*T"31+11 "D/01

    >D/01+,D/01+,>

     44$%, !! 6>D/01+,

    /01+,>D01+,>D/

     44T+ !! !*%IMT+)*3AC"I(CL)(D)D)'L*")!$*3I()3A** 44T, !! !*%IMT,)*3AC"I(CL)(D)D)'L*")!$*3I()3A**

     44$%T !! !*%I6.T+)!$*3I(&L!)3A**)B&LI'"#I6.T+

     44 !! !*%I6.T,)!$*3I(&L!)3A**)B&LI'"#I6.T, 44#$L"A !! **&@TI6

     44#$L" !! **&@TI6 44&@T !! **&@TI6 44T&&L$% !! 6

    *&'T #'&2($%+ @*$%F(CTL+*&'T #'&2($%, @*$%F(CTL,

    *&'T #'&2($%T @*$%F(CTL 44CTL+C%TL !! 6

    *&'T #$"L!*I(+)+1)CQ)A&@T#$L #%A2"*IT+)&@T'"CI(+)01)C+

  • 8/21/2019 part 2 -JCL

    26/33

    2,

     44CTL,C%TL !! 6*&'T #$"L!*I(+)+1)CQ)A

    &@T#$L #%A2"*IT,)&@T'"CI(+)01)C, 44CTLC%TL !! 6

    *&'T #$"L!*I(+)+1)CQ)A*@2 #$"L!*I(0+)+)G!

    &@T#$L #%A2"*I&@T)$%CL@!"I(0+)+)G!)"S))&@T'"CI(+)01&@T#$L #%A2"*I#$L"A)$%CL@!"I(0+)+)CQ)"S)C+)&@T'"CI(+)01

    &@T#$L #%A2"*I#$L")$%CL@!"I(0+)+)CQ)"S)C,)&@T'"CI(+)01 46

    "xplanationE

    CTL+ ? Add + to all the records of the first file at 01th columnCTL, ? Add , to all the records of the second file at 01 th column

    CTL ? Concatenate both files and sort the file on ;ey if duplicates found) sum on 0+ st

    column. *o if any record exists in both the file) it :ill have after summing.

    *o no: extract records :ith 5+= ) 5,= and 5= into three files. Hhile :riting the records)

    remove the 0+st byte added for our temporary purpose. 5+= ? 'ecords only in first file

     5,= ? 'ecords only in second file. 5= ? 'ecords exist in both the files.

    $"Q3'&F2$t is used to

    +.Catalog a dataset (CATLF !*%A2"IA..C) B&LI*"'Innnn,.@ncatalog a dataset (@%CATLF !*%A2"IA..C

    .'ename a dataset ('"%A2" !*%A2"IA..C)B&LI*"'Innnn)%"H%A2"I!.".#>.Create an index for F!F (L!F $%!"

  • 8/21/2019 part 2 -JCL

    27/33

    20

    nnnn is generation number (1+- and xx is version number (11-.

    Re#err"n> Generat"on! "n JCL

    The current generation is referred by F!FA*"(1) the previous generation byF!FA*"(-+ and the next generation by F!FA*"(U+.

    F"%"'AT$&%* A'" @3!AT"! &%L AT TQ" "%! TQ" J&. $t means) if thefirst step creates one generation) code it as F!FA*"(U+ and if the second step createsanother generation) then it *Q&@L! be coded as F!FA*"(U, as the (U+ version is not

    yet promoted to current version. *imilarly to refer the F!F created in the second step) referit by F!FA*"(U,.

    F!F datasets can be also referenced :ith their generation number li;e

     5221+.3A'&LL.2A*T"'.F11+B11= 

    Adanta>e o# GDG

    +. F!F datasets are referred in the JCL using F!F base and relative number. *o the sameJCL can be used again and again :ithout changing the dataset name and this is the biggest

    advantage of F!F.

    ,.F!F ase has pointers to all its generations. Hhen you :ant to read all the transactionsdone till today) you can easily do it by reading the F!F base if it is available. &ther:ise you

    have to concatenate all the transaction files before reading.

    Creat"on o# GDG

    +.F!F ase is created using $!CA2*. The parameters given :hile creating the F!F areE

    3arameter 3urpose

    %A2" ase of the F!F is given here.

    L$2$T The maximum number of F!F version that can exist at any point

    of time. $t is a number and should be less than ,D.

    "23T4%&"23T Hhen the L$2$T is exceeded)"23T ;eeps &%L the most recent generation.%&"23T ;eeps the L$2$T number of ne:est generation.

    *C'ATCQ4%&*C'ATCQ

    *C'ATCQ un-catalogue and deletes the versions that are not ;ept.%&*C'ATCQ ust does un-cataloguing and it is not physically

    deleted from the volume.

    &H%"' &:ner of the F!F.

    #&' !A* (n 4T& (!AT"

    "xpiry date. Can be coded either in the unit of days or tillparticular date.

    ,. 2odel dataset is defined after or along :ith the creation of base. &nce model !C is

    defined) then during the allocation of ne: versions) :e no need to code !C parameter.2odel !C parameter can be overridden by coding ne: parameter :hile creating the F!Fversion. $t is :orth to note that t:o F!F version can exist in t:o different formats.

    A step that defines a F!F and allocates a model !*C

     44F!F "

  • 8/21/2019 part 2 -JCL

    28/33

    2

     44 @%$TI**!A)B&LI*"'I23*011)*3AC"I(T'K)(1) 44 !CI(!*&'FI3*)'"C#2I#)L'"CLI>11

     44**$% !! 6 !"#$%" F!F ( %A2"(221+.3A'&LL.2A*T"' -

      L$2$T(D -  %&"23T -

      *C'ATCQ  46

    Qo: to *olve A"%!*]

    There are t:o ;inds of abends- @*"' and **T"2.

    @*"' (@nnnn **T"2 (*nnnn

    3refixed :ith @ 3refixed :ith *

    Application !riven ? The application

    program issues the user abend by calling

    installation specific abend routine.$2 *upplied abend routineE $L&A%1

    *ystem !riven ? Hhen the system is not

    able to perform a statement) it abended

    :ith respective system abend.

    2&B" T& A"%!-C&!"CALL 5$L&A%1= @*$%F A"%!-C&!"

    This code Hill abend the program :ith

    @1.

    "xE $n a billing application) the countryreferred in the bill-to address is missing

    in the country table :hich is an seriousissue and so the program :ill be :ritten

    in such a :ay to abend in this scenario.

    "xE Trying to do an arithmetic operationon non-numeric data. As system could

    not perform this) it :ill abend :ith *1C/.

    *olutionE Loo; for the abend code in the

    program and study the application logic

    behind this abend. Then appropriately fixthe data4rerun.

    *olutionE 'efer $2 2anuals for system

    abend and ta;e appropriate action. ou

    may need to analyse program4data to fixbased on type of abend.

    *ystem abends can be environment (space4region related or programrelated(logic4data driven logic. #ixing a program related abend is comparatively

    complicated than enviroment related system abends or user abends.

    The usual process to solve a system abend isE

    +.'efer the **&@T of the ob and get the next sequential instruction to be executed

    (&ffset.,.Compile the program :ith L$*T option if the compiled one is not :ith either L$*T or

    #*"T option..Chec; for the offset in the compilation list and Fet the respective statement number.

    >.$dentify the statement. This :ould be a numeric operation on non-numeric data.

    D.$dentify the source of the non-numeric data and correct it.

    Though the process loo;s simple and this :ill :or; 1 percent of the cases) the questions

    areE

  • 8/21/2019 part 2 -JCL

    29/33

    2

    $n case offset and the abending module is not displayed in the sysout) ho: toproceed]

    $n case of data-exception ;ind of abend) if the particular statement referred morethan one field) ho: do you conclude :hich field have problem :ithout display and rerun]

    $f the source for the field in problem is in file) ho: do you ;no: :hich record of thisfield in the file]

    !ump 'eading exposure :ill help you in all these cases. As dump reading ;no:ledge is

    important for any maintenance 4 support proect) let us study :ith a simple exampleE

    *imple 3rogram

      CB! !ISTIDENTIFIC"TION DIISION.

    PROGR"M&ID.S"NSOFT.

    *

    ENIRONMENT DIISION.

    *

    D"T" DIISION.

    %ORKING&STOR"GE SECTION.01 %S&"RI"B!ES.

    0' %S&EMP&N"ME PIC X(10).

    0' %S&EMP&"GE PIC (02).

    0' %S&EMP&CITY PIC X(10).

    0' %S&EMP&S"! PIC S(0$).

    0' %S&EMP&BONUS PIC S(0$).

    0' %S&EMP&CTC PIC S(0$).

    *

    PROCEDURE DIISION.

    *

    MOE MUTHU TO %S&EMP&N"ME

    MOE 2 TO %S&EMP&"GE

    MOE TRICHY TO %S&EMP&CITY

    MOE 0000 TO %S&EMP&S"!

    COMPUTE %S&EMP&CTC = (%S&EMP&S"! * 12) + %S&EMP&BONUSDISP!"Y S"NSOFT COMP!ETED

    DISP!"Y EMP!OYEE DET"I! %S&EMP&N"ME ,

    %S&EMP&"GE ,

    %S&EMP&CITY ,

    %S&EMP&S"! ,

    %S&EMP&CTC

    STOP RUN.

    The program is compiled :ith L$*T option to get assembler listing.

    &n successful compilation) the program is submitted :ith the JCL.

    The program is abended and the sysout saysE

    CEE#20-S T 3 454 6 466 7589:; (S3 C:38

  • 8/21/2019 part 2 -JCL

    30/33

    3

    000021 MOE

    000#'$ D20- 201 "0BD MC 22($,2),1$(10) (B!%=0)+22 PGM!IT "T +1$'

    000022  COMPUTE

    000#'E F2@- D0F$ 201E P"CK 2@$(',1#),#0($,2) TS2=0 %S&EMP&BONUS

    000#@ D20F D0E$ "0$D MC 2#2(1,1#),1@1(10) TS1=0 PGM!IT "T +1#-

    00036A FA54 D0F2 D0F8 AP 242(6,13),248(5,13) TS1=10 TS2=0

    000#-0 @0F D0F# NI 2@#(1#),X0F TS1=11

    000#-@ F$@@ D0F# D0F# A"P 2@#(',1#),2@#(',1#) TS1=11 TS1=11

    000#-" F#-@ 202 D0F# UNPK #$($,2),2@#(',1#) %S&EMP&CTC TS1=1100002# DISP!"Y

    D"-/# belongs to the C&23@T" statement that is in line 1111,,.

    %o: loo; for line 111,, in compilation listing.

      000021 MOE 0000 TO %S&EMP&S"!

    000022 COMPUTE WS-EMP-CTC = (WS-EMP-SAL * 12) + WS-EMP-BONUS

    00002# DISP!"Y S"NSOFT COMP!ETED

    *o one of this field referred in this statement has un; in it. Just before compute :epopulated H*-"23-*AL and so there is a problem :ith H*-"23-&%@*. $f you go thru the

    code) you :ill find the developer missed to populate4initialie H*-"23-&%@* and that has

    caused data exception.

    $f these fields are from file) :e cannot easily confirm li;e above. *o :e have to give display

    for these t:o fields in the program and rerun the program or loo; for un;s in the source file

    for these t:o fields using #$L" A$!4 $%*%C. The other approach :ill be loo; into datadivision map in the compilation listing.

    0S:>5 H965 6;4 B6 H7&D98

    2 PROGR"M&ID S"NSOFT&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*

    $ 1 %S&"RI"B!ES. . . . . . B!%=00000 000 DS 0C!@ G:>8

    2 %S&EMP&N"ME . . . . . B!%=00000 000 0 000 000 DS 10C D983

    1# 2 %S&EMP&BONUS. . . . . B!%=00000 01E 0 000 01E DS $C D98&N>3

    1@ 2 %S&EMP&CTC. . . . . . B!%=00000 02 0 000 02 DS $C D98&N>3

    H*-"23-*AL is in LH-1 offset + :hereas H*-"23-&%@* in offset 1+".

    $n the dump) loo; for :or;ing-storage dump. LH-1 maps to ,/010 address.

    %ORKING&STOR"GE ?: S"NSOFT

    B!%&0 2-$0B$

    +000000 2-$0B$ D@E@E#C$ E@@0@0@0 @0@0F2F E#DCC#

    C$E$@0@0 @0@0F0F0 F0FF0F0 F0C00000

    MUTHU 2TRICHY 000000...

    +000020 2-$0D$ 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000

    ................................

    B!%&0 2-$0B$

    +000000 2-$0B$ D@E@E#C$ E@@0@0@0 @0@0F2F E#DCC# C$E$@0@0 @0@0F0F0 F0FF0F0 F0C00000

    MUTHU 2TRICHY 000000...

    +000020 2-$0D$ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

    ................................

  • 8/21/2019 part 2 -JCL

    31/33

    31

    H*-"23-%A2" is +1 bytes starting at 1 - 5!>">"C0">>1>1>1>1>1= :hich is nothingbut 52@TQ@ 5. H*-"23-AF" is , bytes starting at +1th byte :hich is 5,= (5#,#=. *imilarly

    read the contents of H*-"23-C$T) H*-"23-*AL) H"-"23-&%@* and H*-"23-CTC.H*-"23-&%@* contains lo:-values. $t is a computational field and so it is expected

    to have sign in the last nibble :hereas it doesnot as it is not properly initialised in theprogram.

    $n the dump) in every line there :ill be t:enty bytes hexa decimal content :ill be

    follo:ed by character content. !ue to the column limit) $ have the one line dump in threelines.

    *o if there are million records in a file and during the processing it abended after 5n=

    number of records) to identify the record caused problem) read the dump for the file sectionunique variable(s values and loo; for the respective record in the file and

    analyse4correct4delete.

    He have ta;en offset directly from sysout. $f it is not available) then refer the 3*H.

    ased on A2&!" ,>4+) the last ,>4+ bits contain the next sequential instruction to beexecuted. #rom this value) subtract the entry point of the program being abended and that

    :ill give you offset. &ne instruction above this offset is the one that caused the abend."ntry point of all the programs executed be found in trace bac; or save trace section of thedump. ou can directly found the offset in the tracebac; also. (last + bits of A/1++01 is

    ,/1++01) ,/1++01-,/11"+1 I /1 is the offset) from the compilation listing oneinstruction ust before /1 is A.

    PS%..... 0-$D1000 A!01180

    T6565

    DS" "44 P:63 U;9 PU "44 PU O?? E; E "44 E O??

    0001D120 CEEHDSP 0'--$0F0 +0000#C#@ CEEHDSP 0'--$0F0 +0000#C#@

    0001D01$ S"NSOFT 2-00E10 +0000036A   S"NSOFT 2!00E10  +00000#"

    S63; !:64 M:4 S95 S6>

      CEEP!PK" UK001' C6

  • 8/21/2019 part 2 -JCL

    32/33

    32

    *ubmission of Job from C$C* 3rogramJCL can be submitted from C$C* by *3&&L &3"%) *3&&L H'$T" and *3&&L CL&*"

    commands. This needs *3&&LI"* entry in *$T table. 'efer C$C* section for more details.

    *torage 2anagement *ubsystem$t is optional feature of the operating system that manages user datasets. The *2*

    parameters apply only to the ne: datasets and the system ignores for existing datasets)!!6 or !! !ATA datasets) J&CAT and J&L$ !! statements) and **&@T datasets.

    The follo:ing data classes establish various default values for catalogued datasets.

    An administrator assigns a name to each group of default values) and then you referencethis name on your !! statements to use the values.

    *T&'CLA* ? !efines @%$T and B&L parameters

    !ATACLA* - !efines '"C#2) L'"CL) ABF'"C) *3AC") '"T3!4"

  • 8/21/2019 part 2 -JCL

    33/33

    33

     44*T"3L$ !! !$*3I*Q')!*%ICA$.CA/.L&A!L$ 44@CC/C2!* !! !$*3I*Q')!*%ICA$.CA/.C&22!*

     44**3'$%T !! **&@TI6)!CILK*$G"I+ 44"''&'* !! **&@TI6)!CILK*$G"I+

     44**@!@23 !! **&@TI6 44**$% !!6

     Code the CA/ commands 46

    JCL #&'

    There may be a need to read the run details of a ob log inside the '"