jclb unit 2

Upload: asim

Post on 07-Aug-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/21/2019 JCLb Unit 2

    1/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed.

  • 8/21/2019 JCLb Unit 2

    2/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2 o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

  • 8/21/2019 JCLb Unit 2

    3/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3 o% &'

    JCL programmer" o%ten +"e proed+re" preoded JCL5 to a#oid repetiti#e oding o% in%ormation and a" a

    time "a#ing tehni6+e.

    *hi" +nit de"rie" ata!oged and in"tream proed+re" and their ad#antage". *he +nit %+rther e7p!ain" ho8

    to identi%y a proed+re de%inition in the 9o "tream. *he +nit end" y di"+""ing ho8 to e7e+te a proed+re.

    Unit Introduction

    Unit: Introducing Procedures

    Introd+tion

  • 8/21/2019 JCLb Unit 2

    4/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4 o% &'

     t the end o% thi" +nit, yo+ 8i!! e a!e to

    • :e%ine the term" proed+re, ata!oged proed+re and

    in"tream proed+re

    • Spei%y 8here a proed+re an e !oated

    • Spei%y 8hen to +"e an in"tream proed+re and 8hen

    to +"e a ata!oged proed+re

    • Identi%y the JCL "tatement" that de%ine an in"tream

    proed+re

    • Code the JCL to otain a proed+re !i"ting

    • Code a "tatement to in#o1e a proed+re

    Unit Objectives

    Unit: Introducing Procedures

    Introd+tion

  • 8/21/2019 JCLb Unit 2

    5/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ; o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

  • 8/21/2019 JCLb Unit 2

    6/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age & o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • :e%ine a proed+re

    • :e"rie the ad#antage" o% a proed+re

    Topic Objectives

    Unit: Introducing Procedures

    Introd+tion

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    7/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age < o% &'

    What is a procedure?

      proed+re i" a preoded "et o% JCL "tatement" 8ith a +ni6+e name.

    JCL "tatement" that are +"ed y "e#era! +"er" or +"ed repeated!y are p!aed in a proed+re. ("e o% 

    proed+re" not on!y "a#e" time +t a!"o a#oid" error".

    Procedure

    Unit: Introducing Procedures

    Conept"

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    8/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age = o% &'

    How does a procedure work?

      proed+re i" ro+ght into a 9o "tream at the

    appropriate p!ae to per%orm it" %+ntion 8ith an

    >?>C "tatement that re%er" to it y it" name.

    In the e7amp!e "ho8n, a proed+re a!!ed

    $@OC i" in#o1ed.

    //JSTEP EXEC PROCA

    *hi" !ine e7e+te" the proed+re $@OC.

    Using Procedures

    Unit: Introducing Procedures

    Contin+edA

    Conept"

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    9/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age o% &'

    Mo"t in"ta!!ation" ha#e preoded proed+re" that ena!e yo+ to per%orm ompi!e", !in1 edit" and te"t"

    6+i1!y

    and ea"i!y.

    *o +"e preoded proed+re", the ode m+"t ontain the %o!!o8ing "tatement"

    •   "ing!e >?>C "tatement that in#o1e" the proed+re

    •   :: "tatement to identi%y the "o+re program in a"e o% ompi!e"

    • :: "tatement" %or the te"t data.

    Using Procedures (cont’d)

    Unit: Introducing Procedures

    Conept"

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    10/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '0 o% &'

    *he e7amp!e "ho8n on the right "ho8" a 9o

    "tream to in#o1e a proed+re named COB(CL

    that may e a#ai!a!e to he!p ompi!e, !in1 edit,

    and te"t COBOL program.

    Procedure !n "#a$p%e

    Unit: Introducing Procedures

    //STEP1 EXEC COBUCLG

    //COB.SYSIN DD *

      (source pror

      .

      .

    //GO.SYSIN DD *

      (!es! "#!#$

      .

      .

    /*

    >?>C "tatement that

    In#o1e" the proed+re

    :: "tatement that

    Identi%ie" "o+re program

    >?>C "tatement that

    Identi%ie" te"t data

    Conept"

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    11/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '' o% &'

    !dvantages o& a Procedure

     d#antage" o% +"ing a proed+re are

    • $roed+re" an great!y "imp!i%y JCL

    • $roed+re" he!p in maintaining omp!e7 or !engthy JCL

    • $roed+re" he!p yo+ to "tandardize data "et and program +"age

    Unit: Introducing Procedures

    Conept"

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    12/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '2 o% &'

    Which o& the &o%%owing are advantages o& using procedures?

     . *hey "imp!i%y the JCL yo+ ha#e to ode %or a 9o.

    B. *hey permit "tandardization o% data "et and program +"age.

     

    C. *hey ena!e yo+ to opy parameter #a!+e" %rom pre#io+" :: "tatement".

    :. *hey permit ea"ier maintenane o% JCL.

    !re We on Track?

    Unit: Introducing Procedures

    @e#ie8

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    13/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '3 o% &'

    $roed+re D $repared "et" o% 9o ontro! "tatement" ata!oged in a proed+re !irary.

    Compi!e D *o tran"!ate "o+re !ang+age "tatement" into mahine in"tr+tion".

    Lin1 >dit D *o omine "+ro+tine" into e7e+ta!e program a!!ed a !oad mod+!e.

    '%ossar

    Unit: Introducing Procedures

    !o""ary

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    14/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '4 o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • :e%ine a proed+re

    • :e"rie the ad#antage" o% a proed+re

    Topic u$$ar

    Unit: Introducing Procedures

    S+mmary

    Topic: What is a Procedure?

  • 8/21/2019 JCLb Unit 2

    15/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '; o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

  • 8/21/2019 JCLb Unit 2

    16/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '& o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • :e%ine ata!oged proed+re and in"tream proed+re

    • >7p!ain ho8 to in#o1e the JCL %or a ata!oged and

    in"tream proed+re

    • Identi%y 8hih proed+re i" appropriate %or a gi#enapp!iation

    Topic Objectives

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    Introd+tion

  • 8/21/2019 JCLb Unit 2

    17/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '< o% &'

      proed+re i" re%erred to a" either a ata!oged proed+re or an in"tream proed+re depending +pon 8here

    it i" de%ined.

    What are cata%oged procedures?

    Cata!oged proed+re" are "tored a" memer" o% a partitioned data "et that i" +"ed a" a proed+re !irary.

    -hen a ata!oged proed+re i" +"ed, it" JCL i" ta1en %rom the de%a+!t proed+re !irary, or a +"er"pei%ied

    proed+re !irary.

    *ata%oged Procedures

    IBM "+pp!ie" a proed+re !irary named

    SESI.$@OCLIB.

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    18/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age '= o% &'

    *he JCL %or a ata!oged proed+re i" in#o1ed 8ith a

    "ing!e >?>C "tatement.

    Con"ider a proed+re y name $@OC. *hi" an

    e

    in#o1ed in t8o 8ay"

    $reede the name o% the proed+re 8ith $@OCF

    Synta7

    //GO EXEC PROC%PROCA

    Or y diret!y "pei%ying the proed+re name.

    Synta7

    //GO EXEC PROCA

    Invoking a *ata%oged Procedure

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    19/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ' o% &'

    In+trea$ Procedures

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    In"tream proed+re" are identia! to ata!oged proed+re", e7ept that they are p!aed a!ong 8ith the 9o in

    the inp+t "tream. -hen the proed+re i" in#o1ed, the JCL in the proed+re de%inition i" in"erted at the

    in#oation point in the 9o "tream it"e!%.

    Conept"

  • 8/21/2019 JCLb Unit 2

    20/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 20 o% &'

    *he %o!!o8ing point" m+"t e on"idered 8hi!e +"ing an in"tream proed+re

    • *he JCL %or an in"tream proed+re i" de%ined 8ith the 9o "tream it"e!%.

    • In"tream proed+re" egin 8ith a $@OC "tatement and are terminated y a $>): "tatement.

    • *he in"tream proed+re i" p!aed %o!!o8ing the JOB "tatement +t e%ore the %ir"t >?>C"tatement.

    • *he JCL o% an in"tream proed+re i" merged into the e7e+ta!e portion o% the 9o 8hen an >?>C

    "tatement in#o1e" the proed+re.

    Invoking an In+trea$ Procedure

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    21/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2' o% &'

    *he e7amp!e "ho8n on the right i" an in"tream

    proed+re named @().

    )ote that $@OC egin" the proed+re and $>):

    end" it. *he proed+re i" in#o1ed y the %ir"t

    >?>C "tatement.

    In+trea$ Procedure !n "#a$p%e

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    //R1&' JOB ()$+,S-IT,+CLASS%A

    //RUN PROC

    //GO EXEC PG-%ONE

    //SYSOUT DD SYSOUT%A

    // PEND

    //STEP1 EXEC RUN 

    *hi" i" the

    proed+re

    *hi" e7e+te" the proed+re

    Conept"

  • 8/21/2019 JCLb Unit 2

    22/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 22 o% &'

    *hoosing The ,ight Procedure

    When to use an in+strea$ procedure?

    I% a proed+re i" 9+"t reated and ha" to e te"ted %or error", an in"tream proed+re an e +"ed.

    When to cata%og a procedure?

    I% a thoro+gh!y te"ted proed+re need" to e +"ed y many peop!e, it i" ata!oged %or "+"e6+ent retrie#a!.

     

      ata!oged proed+re i" ea"y to retrie#e and maintain.

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    23/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 23 o% &'

    -atch the &o%%owing ite$s with their de&initions.

    '. $roed+re . proed+re that i" de%ined in the 9o "tream.

    2. Cata!oged proed+re B. $reoded JCL, 8ith a +ni6+e name, 8hih on"i"t" o% one or more 9o

      "tep".

    3. In"tream proed+re C. proed+re that i" "tored in a proed+re !irary.

    !re We on Track?

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    @e#ie8

  • 8/21/2019 JCLb Unit 2

    24/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 24 o% &'

    The &o%%owing are situations in which ou $ight use a procedure. -atch the situations with thetpe o& procedures that wou%d be appropriate.

    '. *e"ting a ne8 proed+re . n in"tream proed+re

    2. Many peop!e 8i!! +"e the proed+re B. ata!oged proed+re

    !re We on Track?

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    @e#ie8

  • 8/21/2019 JCLb Unit 2

    25/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2; o% &'

    $:S D $artitioned :ata Set. data "et on diret ae"" "torage that i" di#ided intopartition", a!!ed memer", eah o% 8hih an ontain a program, part o% a program

    or data.

    JCLLIB D "tatement that ena!e" yo+ to "pei%y yo+r o8n !irary %or !oating ata!oged

    proed+re".

    '%ossar

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    !o""ary

  • 8/21/2019 JCLb Unit 2

    26/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2& o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • :e%ine ata!oged proed+re and in"tream proed+re

    • >7p!ain ho8 to in#o1e the JCL %or a ata!oged and

    in"tream proed+re

    • Identi%y 8hih proed+re i" appropriate %or a gi#en"it+ation

    Topic u$$ar

    Unit: Introducing Procedures Topic: Cataloged and In-Stream Procedures

    S+mmary

  • 8/21/2019 JCLb Unit 2

    27/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2< o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

  • 8/21/2019 JCLb Unit 2

    28/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2= o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • Identi%y in"tream proed+re"

    • :e"rie the %+ntion o% a $@OC "tatement

    • :e"rie the %+ntion o% a $>): "tatement

    • :i"+"" an in"tream proed+re de%inition

    • Identi%y the "tep" in a proed+re de%inition

    Topic Objectives

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    Introd+tion

  • 8/21/2019 JCLb Unit 2

    29/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 2 o% &'

    How to identi& an in+strea$ procedure?

     n in"tream proed+re an e identi%ied y the "tatement" $@OC and $>):.

    *he %+ntion o% the $@OC "tatement i" to i"o!ate the in"tream proed+re de%inition %rom the re"t o% the

    JCL

    "tatement" %or a 9o.

    In+trea$ Procedure

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    30/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 30 o% &'

    *he $@OC "tatement identi%ie" the name y

    8hih the proed+re i" in#o1ed.

    Gor e7amp!e, the $@OC "tatement to identi%y the

    eginning o% an in"tream proed+re named

    $@OC i"

    //PROCA PROC

    P,O* tate$ent

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    //-YJOB JOB '001&+D.ROSE

    //PROCA PROC

    //PSTEP1 EXEC PG-%-YPROG//DDIN DD DSN%INDATA+DISP%SR

    //DDOUT DD SYSOUT%A

    // PEND

    *hi" de%ine" the

    proed+re

    Conept"

  • 8/21/2019 JCLb Unit 2

    31/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3' o% &'

    *he $>): "tatement immediate!y %o!!o8" an

    in"tream proed+re de%inition.

    It an e +"ed 8ith or 8itho+t a name.

    // PEND

    or 

    //ENDPROC PEND

    P"/0 tate$ent

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    //-YJOB JOB '001&+D.ROSE

    //PROCA PROC

    //PSTEP1 EXEC PG-%-YPROG//DDIN DD DSN%INDATA+DISP%SR

    //DDOUT DD SYSOUT%A

    // PEND 

    *hi" de%ine" the

    proed+re

    Conept"

  • 8/21/2019 JCLb Unit 2

    32/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 32 o% &'

    "nter the 1*2 state$ent that begins an in+strea$ procedure 33333333333.

    !re We on Track?

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    @e#ie8

  • 8/21/2019 JCLb Unit 2

    33/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 33 o% &'

     n in"tream proed+re de%inition an e in!+ded any8here 8ithin a 9o "tream %o!!o8ing the JOB

    "tatement, +t it m+"t preede the >?>C "tatement that in#o1e" the proed+re.

    enera!!y, the de%inition" %or an in"tream proed+re are p!aed at the eginning o% the 9o "tream.

    In+trea$ Procedure 0e&inition

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    Conept"

  • 8/21/2019 JCLb Unit 2

    34/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 34 o% &'

    *he e7amp!e on the right "ho8" a 9o "tream

    that ontain" an in"tream proed+re de%inition

    named $@OC.

    *he JCL et8een the $@OC and $>):

    "tatement" de%ine" the proed+re. *he

    >?>C "tatement that re%er" to the proed+rename e7e+te" it.

    In+trea$ Procedure !n "#a$p%e

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    //-YJOB JOB '001&+D.ROSE

    //PROCA PROC

    //PSTEP1 EXEC PG-%-YPROG//DDIN DD DSN%INDATA+DISP%SR

    //DDOUT DD SYSOUT%A

    // PEND //STEP1 EXEC PG-%PROG1

    //DD1 DD DSN%DATA1+DISP%SR

    //DD& DD SYSOUT%A

    //STEP& EXEC PROCA  *hi" de%ine" the

    proed+re

    *hi" e7e+te" the proed+re

    Conept"

    /OS MVS JCL I di

  • 8/21/2019 JCLb Unit 2

    35/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3; o% &'

    ,e&er to the procedure &or -41O5 shown be%ow

    Which o& the &o%%owing "6"* state$ents invokes the procedure?

     . EXEC PROCA

    B. EXEC PG-%PROG1

    C. EXEC PG-%-YPROG

    !re We on Track?

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    @e#ie8

    //-YJOB JOB '001&+D.ROSE//PROCA PROC

    //PSTEP1 EXEC PG-%-YPROG//DDIN DD DSN%INDATA+DISP%SR

    //DDOUT DD SYSOUT%A// PEND//STEP1 EXEC PG-%PROG1

    //DD1 DD DSN%DATA1+DISP%SR//DD& DD SYSOUT%A

    //STEP& EXEC PROCA

    /OS MVS JCL I t di t

  • 8/21/2019 JCLb Unit 2

    36/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3& o% &'

      proed+re de%inition may ha#e "e#era!proed+re "tep". >ah "tep on"i"t" o% the

    %o!!o8ing

    •  n >?>C "tatement that identi%ie" a

    program to e e7e+ted

    • *he :: "tatement" re6+ired to de%ine

    the data "et" to e +"ed or reated y

    the program

    Procedure 0e&inition

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    //-YJOB JOB '001&+D.ROSE

    //PROCA PROC

    //PSTEP1 EXEC PG-%-YPROG//DDIN DD DSN%INDATA+DISP%SR

    //DDOUT DD SYSOUT%A

    // PEND 

    //STEP1 EXEC PG-%PROG1

    //DD1 DD DSN%DATA1+DISP%SR

    //DD& DD SYSOUT%A

    //STEP& EXEC PROCA

    Conept"

    /OS MVS JCL I t di t

  • 8/21/2019 JCLb Unit 2

    37/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3< o% &'

    *he in"tream proed+re de%inition on theright ontain" the %o!!o8ing t8o proed+re

    "tep"

    • $S*>$', 8hih e7e+te" a program

    named $@O'

    • $S*>$2, 8hih e7e+te" a program

    named $@O2

    $S*>$' identi%ie" the program name $@O'5.

    *he :: "tatement" that %o!!o8 de%ine the data

    "et" that 8i!! e reated y the program.

    In+trea$ Procedure 0e&inition !n "#a$p%e

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    //TRANSACT PROC

    //PSTEP1 EXEC PG-%PROG1//DD1 DD DSN%INTRAN+DISP%SR

    //DD& DD DSN%-ASTER+DISP%SR//DD' DD SYSOUT%A

    //DD DD DSN%2ALID+UNIT%SYSDA+// DISP%(NE3+PASS$+SPACE0(TR4+(1+1$$//PSTEP& EXEC PG-%PROG&

    //DD) DD DSN%2ALID+DISP%(OLD+DELETE$

    //DD DD SYSOUT%A

    //PEND

    Conept"

    /OS MVS JCL I t di t

  • 8/21/2019 JCLb Unit 2

    38/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3= o% &'

    Which o& the &o%%owing can be par t o& a procedure de&inition?

     . $@OC "tatement

    B. >?>C "tatement in#o1ing the "ame proed+re

    C. $roed+re "tep :: "tatement"

    :. $>): "tatement

    !re We on Track?

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    @e#ie8

    /OS MVS JCL I t di t

  • 8/21/2019 JCLb Unit 2

    39/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 3 o% &'

    7o%%owing are 1*2 state$ents &ro$ a sa$p%e job strea$ containing an in+strea$ procedure. P%acethe state$ents in the correct order.

     . //PSTEP1 EXEC PG-%-YPROG

    B. //STEP1 EXEC PROCA

    C. //PROCA PROC

    :. //-YJOB JOB ''001&+D.ROSE

    >. // PEND

    G.//DDIN DD DSN%INDATA+DISP%S

    . //DDOUT DD SYSOUT%A

    !re We on Track?

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    @e#ie8

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    40/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 40 o% &'

    $roed+re :e%inition D *he JCL "tatement" that de%ine a proed+re, 8hih may on"i"t o%"e#era! proed+re "tep".

    '%ossar

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    !o""ary

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    41/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4' o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • Identi%y in"tream proed+re"

    • :e"rie the %+ntion o% a $@OC "tatement

    • :e"rie the %+ntion o% a $>): "tatement

    • :i"+"" an in"tream proed+re de%inition

    • Identi%y the "tep" in a proed+re de%inition

    Topic u$$ar

    Unit: Introducing Procedures Topic: Identifying In-Stream Procedures

    S+mmary

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    42/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 42 o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    43/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 43 o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • >7p!ain ho8 to ata!og a proed+re

    Topic Objectives

    Unit: Introducing Procedures Topic: Cataloging Procedures

    Introd+tion

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    44/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 44 o% &'

    *ata%oging

    What is cata%oging?

    One an in"tream proed+re i" te"ted, it an e ata!oged %or genera! +"e. Cata!oging mean" "toring it

    in a proed+re !irary $:S5 +"ing a +ti!ity program.

    One an in"tream proed+re ha" een ata!oged, the >?>C "tatement that in#o1e" thi" proed+re re%er" to

    it y it" memer name in the proed+re !irary.

    Unit: Introducing Procedures Topic: Cataloging Procedures

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    45/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4; o% &'

    In the e7amp!e, notie that the proed+re name $@OC hange" to the memer name $@OC'23 one the

    proed+re i" ata!oged.

    ("er" m+"t then in#o1e the proed+re +"ing the name $@OC '23.

    *ata%oging !n "#a$p%e

    Unit: Introducing Procedures Topic: Cataloging Procedures

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    46/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4& o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • >7p!ain ho8 to ata!og a proed+re

    Topic u$$ar

    Unit: Introducing Procedures Topic: Cataloging Procedures

    S+mmary

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    47/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4< o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    48/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4= o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • >7p!ain the need %or proed+re !i"ting"

    • :e"rie ho8 to otain proed+re !i"ting"

    Topic Objectives

    Unit: Introducing Procedures

    Introd+tion

    Topic: Obtaining a Procedure Listing

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    49/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age 4 o% &'

    Be%ore a proed+re i" +"ed, the +"er "ho+!d otain a JCL !i"ting and e7amine it" ontent" to en"+re that itmeet" the proe""ing re6+irement".

    *he +"er m+"t determine that the proed+re eing +"ed e7e+te" the right program" in the proper 

    "e6+ene, +"ing appropriate data "et".

    Overview

    Unit: Introducing Procedures Topic: Obtaining a Procedure Listing

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    50/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;0 o% &'

    How to obtain a procedure %isting?

      proed+re !i"ting an e otained +"ing one o% the %o!!o8ing method"

    • ("e the I>B>)>@ +ti!ity.

    ("e the I>B$*$CH +ti!ity.

    • >7e+te a 9o and in!+de the *E$@()FSC) parameter on the JOB "tatement. *hen, 8ithin the

     9o "tream, in!+de an >?>C "tatement that re%er" to the proed+re to e !i"ted.

    Procedure 2isting

    Unit: Introducing Procedures Topic: Obtaining a Procedure Listing

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    51/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;' o% &'

    Procedure 2isting !n "#a$p%e

    *he %o!!o8ing e7amp!e "ho8" ho8 to +"e *E$@()FSC) to otain a !i"ting o% a ata!oged proed+renamed $@OCB.

    //-YJOB JOB '0&01&+D.ROSE+

    // TYPRUN%SCAN

    //JSTEP EXEC PROCB

    Unit: Introducing Procedures Topic: Obtaining a Procedure Listing

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    52/61

    z/OS MVS JCL Intermediate

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;2 o% &'

     4ou can get a procedure %isting b coding 3333333333 on the 1O5 state$ent o& a job that invokes

    the procedure.

    !re We on Track?

    Unit: Introducing Procedures Topic: Obtaining a Procedure Listing

    @e#ie8

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    53/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;3 o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • >7p!ain the need %or proed+re !i"ting"

    • Identi%y ho8 to otain proed+re !i"ting"

    Topic u$$ar

    Unit: Introducing Procedures Topic: Obtaining a Procedure Listing

    S+mmary

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    54/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;4 o% &'

    ()I* Introd+ing $roed+re"

      -hat i" a $roed+re

      Cata!oged and InStream $roed+re"

      Identi%ying InStream $roed+re"

      Cata!oging $roed+re"

      Otaining a $roed+re Li"ting

      In#o1ing a $roed+re

    *opi"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    55/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;; o% &'

     t the end o% thi" topi, yo+ 8i!! e a!e to

    • Identi%y ho8 to in#o1e a proed+re

    • Identi%y ho8 to otain a proed+re name

    Topic Objectives

    Unit: Introducing Procedures Topic: Invoking a Procedure

    Introd+tion

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    56/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;& o% &'

      proed+re i" in#o1ed 8ith an >?>C "tatement that identi%ie" the proed+re y name.

    *he e7amp!e "ho8n in#o1e" a proed+re named $@OC.

    Invoking a Procedure

    Unit: Introducing Procedures Topic: Invoking a Procedure

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    57/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;< o% &'

    *o in#o1e the proed+re $@OC the %o!!o8ing "tatement an e +"ed

    //JSTEP1 EXEC PROC%PROCA

    In another 8ay o% in#o1ing a proed+re, the programmer an omit $@OCF in the >?>C "tatement. In thi"

    %ormat on!y proed+re name i" gi#en.

    In the e7amp!e on"idered, the proed+re $@OC an a!"o e in#o1ed in the %o!!o8ing 8ay

    //JSTEP1 EXEC PROCA

    How to obtain the procedure na$e to speci& in the "6"* state$ent ?

    Gor an in"tream proed+re, the proed+re name 8o+!d e the name identi%ied in the $@OC "tatement.

    Gor a ata!oged proed+re, the proed+re name 8o+!d e the name +nder 8hih the proed+re 8a"

    ata!oged.

    Procedure /a$e

    Unit: Introducing Procedures Topic: Invoking a Procedure

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    58/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ;= o% &'

    What is the di&&erence between invoking aprocedure and a progra$?

    *o in#o1e a proed+re the 1ey8ord parameter 

    $@OCF an e +"ed e%ore the proed+re name

    or it an e omitted.

    Ho8e#er, to in#o1e a program, the 1ey8ord

    parameter $MF m+"t e +"ed e%ore the

    program name.

    Con"ider the e7amp!e" "ho8n on the right.

    *he %ir"t t8o e7amp!e" in#o1e a proed+re. *he

    "eond one in#o1e" a program.

    Invoking a Progra$

    Unit: Introducing Procedures Topic: Invoking a Procedure

    //-YJOB JOB '001&+D.ROSE

    //JSTEP1 EXEC PROCA

    *hi" e7e+te" a proed+re

    //-YJOB JOB '001&+D.ROSE

    //JSTEP1 EXEC PROG%PROGA

    *hi" e7e+te" a program

    //-YJOB JOB '001&+D.ROSE

    //JSTEP1 EXEC PROC%PROCA

    *hi" e7e+te" a proed+re

    Conept"

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    59/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age ; o% &'

    *ode a state$ent to invoke a procedure na$ed 6489 

    //STEPNA-E 5555555.

    !re We on Track?

    Unit: Introducing Procedures Topic: Invoking a Procedure

    @e#ie8

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    60/61

    © Copyright IBM Corp., 2000, 2004. !! right" re"er#ed. $age &0 o% &'

    )o8 that yo+ ha#e omp!eted thi" topi, yo+ "ho+!d e a!e to

    • Identi%y ho8 to in#o1e a proed+re

    • Identi%y ho8 to otain a proed+re name

    Topic u$$ar

    Unit: Introducing Procedures Topic: Invoking a Procedure

    S+mmary

    z/OS MVS JCL Intermediate

  • 8/21/2019 JCLb Unit 2

    61/61

    )o8 that yo+ ha#e omp!eted thi" +nit, yo+ "ho+!d e a!e to

    • :e%ine the term" proed+re, ata!oged proed+re and

    in"tream proed+re

    • Spei%y 8here a proed+re an e !oated

    • Spei%y 8hen to +"e an in"tream proed+re and 8hen

    to +"e a ata!oged proed+re

    • Identi%y the JCL "tatement" that de%ine an in"tream

    proed+re

    Code the JCL to otain a proed+re !i"ting

    • Code a "tatement to in#o1e a proed+re

    Unit u$$ar

    Unit: Introducing Procedures