FALSE

Page Nav

HIDE

Grid

GRID_STYLE

ADVANCED JCL FEATURES

ADVANCED JCL FEATURES •       PARMS, Referbacks and Concatenations •       Using the OUTPUT statement •       Coding the COND parameter PARM...

ADVANCED JCL FEATURES

      PARMS, Referbacks and Concatenations

      Using the OUTPUT statement

      Coding the COND parameter

PARMs, Referbacks and Concatenations

      Coding PARM parameter

      Concatenating data sets

      Coding Referbacks within a Job Step

      Coding Referbacks to other Job Steps or Procedures

PARM PARAMETER

      Function of PARM parameter

      Coding PARM parameter

 

Function of PARM parameter

      Passes small amount of info from JCL to Program

      May contain info that may change each time when program executes

      Example : In monthly reports, we can pass the month in the heading of  a report.

Coding PARM parameter

      Keyword parameter

      Code PARM in EXEC statement

 

      //step1  EXEC ……., PARM=value

      //step1  EXEC …, PARM=(val1, ‘val+2’)

      //step1  EXEC …, PARM=‘val1, val2’

 

Coding PARM parameter

      value must not exceed 100 characters

      ( )  ‘ ‘ are not included in 100

        , is included

      Special char should be enclosed in  quotes.

      E.g.   ‘REP.NO’  ‘VAL+UE’ 

 

Concatenating data sets

•   Function of data set concatenation

•   Coding concatenated data sets

 

FUNCTION

      Naming two or more data sets in a single input file without physically combining the data sets

      Data sets may reside on different devices and also on different  device types

 

CODING 

//DD1   DD  DSN=A,DISP=SHR

//           DD  DSN=B,DISP=SHR

 

      The order of DD statements determines the order in which the program  accesses the data sets

       If the record length of the first DD statement is not MAX then an abend will occur. To avoid this either    

      Code the DCB parameter with largest block size in first DD statement if the first data set is not the one with largest block size or LRECL.

// DD2     DD   DSN=A,DISP=SHR,

//                    DCB=LRECL=131

//            DD   DSN=B,DISP=OLD

 

                                    OR





 //DD2    DD   DSN=A,DISP=SHR,

//                 DCB=BLKSIZE=23200

//            DD  DSN=B,DISP=OLD

//            DD  DSN=C,DISP=OLD

 


 BACKWARD REFERENCE

      Function and position of referback

      Coding DCB, DSN, and VOLUME referbacks

       Referbacks will improve consistency

       Referbacks make coding easier.

 

 

BACKWARD REFERENCE

      Lets you copy previously coded info by referring back to an earlier statement

      Can reference the statement in

          -        the same step

          -        previous step in the same job

          -        an in-stream PROC

          -        a cataloged PROC

      Can be in DCB, DSN, VOL parameters

CODING   DCB

// JOB Statement.…….

//STEP1   EXEC ……

//INPF      DD DSN=TEST.INFILE,DISP=OLD

//INTF     DD DSN=TEST.INTFILE,

//              DISP=(,CATLG),DCB=BLKSIZE=8000

……

//OUTF    DD  DSN=TEST.OUTF,

//                     DISP=(,CATLG,DELETE),

//                     DCB=*.INTF

 




 CODING DSN

 

      Same procedure for DSN

CODING VOL using dd name

 

//DD1   DD  DSN=NAME1,

//                    VOL=SER=VOL1

//DD2   DD  DSN=NAME2,

//                   VOL=REF=*.DD1

 

CODING VOL using dsname

      Can also reference by data set name with only CATLG, PASS data sets option in DISP

      VOL=REF=dsname

      VOL=REF=NAME1

      When using generation data sets, this cannot be used.

REFERBACKS IN THE SAME JOB STEP

      When referring to DD name in same job step code

      DCB=*.ddname

      DSN=*.ddname

      VOL=REF=*ddname

      VOL=REF=dsname

 

REFERBACKS TO OTHER JOB STEPS

      DCB=*.stepname.ddname

       DSN=*.stepname.ddname

//Step1   EXEC PGM=pgm1

//infile1  DD DSN=name1,DISP=shr,

//Step2    EXEC PGM=pgm2

//outfile2 DD DSN=name2,DISP=(new,catlg),

//                     DCB=*.Step1.infile1

 

REFERBACKS TO PROCEDURES

      When referring procedures (in-stream/catalog)

 

      DCB=*.stepname.procstepname.ddname

 

       DSN=*.stepname.procstepname.ddname

 

 

 

OUTPUT STATEMENT

      Referencing the OUTPUT statement

      Coding the COPIES ,OUTLIM and CLASS parameters

      Coding the DEST, FORMS and GROUPID parameters

      Coding implicit and explicit references

ADVANTAGES OF OUTPUT

      Combine common output characteristics

      Create multiple printouts with different output characteristics

      Combine several SYSOUT DDs into groups

COPIES PARAMETER

//   OUTPUT COPIES=nnn

      nnn is from 1 to 254

      Default value is 1

CLASS PARAMETER

Certain attributes are defined at system startup. Few are:

      How to process report

      Report line is 80 or 132 character

      NO of lines per page

      What time the report should print  etc

      E.g : A=line print, 132 char, B=card punch

 

 

 

//OUT2 OUTPUT CLASS=n

where n =A to Z or 0 to 9.

       CLASS=*  requests output from MSGCLASS in JOB statement.

       CLASS on SYSOUT DD overrides CLASS on OUTPUT statement.

       To nullify CLASS parameter in  SYSOUT  DD

        //DD2 DD SYSOUT=(,),     OUTPUT=*.OUT2

OUTLIM Parameter

      The outlim parameter limits the no of print lines.

      The limit range range from 1 to 16777215 lines. The job is terminated if the limit is exceeded.

 

      //name  DD SYSOUT=A,OUTLIM=3000

DEST PARAMETER

      Routes the data set to a destination, device or location

//REMT2  OUTPUT DEST=type

      type is 2 to eight alphanumeric or national character

      If not coded default is taken.

FORMS PARAMETER

      Specifies the type of forms on which the sysout data set is to be printed or punched.

      //PRT2  OUTPUT FORMS=form name

      Form name is2 to eight alphanumeric or national character

      SYSOUT DD FORMS parameter overrides OUTPUT FORMS parameter.

      SYSOUT DD FORMS is only 4 character

 

Combine common output characteristics (contd)

//JOBNAME  JOB ….

/OUTRPT  OUTPUT  DEST=HQS,COPIES=3,FORMS=PQ

//STEP1     EXEC  PGM=A

//NAME1  OUTPUT  DEST=LP

//DD1       DD  SYSOUT=A,OUTPUT=*.OUTPRT

//STEP2    EXEC  PGM=B

//DD2        DD  SYSOUT=A,OUTPUT=*. OUTPRT

//STEP3    EXEC  PGM=C

//DD3        DD     SYSOUT=A,OUTPUT=*.OUTPRT

 

Combine common output characteristics

//JOBNAME  JOB ….

//STEP1  EXEC  PGM=A

//DD1   DD  SYSOUT=A,DEST=LP

//STEP2   EXEC  PGM=B

//DD2   DD  SYSOUT=A,DEST=LP

//STEP3   EXEC  PGM=C

//DD3   DD  SYSOUT=A,DEST=LP

//JOBNAME  JOB ….

//NAME 1 OUTPUT  DEST=LP

//STEP1  EXEC  PGM=A

//DD1   DD

   SYSSOUT=A,OUTPUT=*.NAME1

//STEP2   EXEC  PGM=B

//DD2   DD  SYSOUT=A,OUTPUT=*.NAME1

//STEP3   EXEC  PGM=C

//DD3   DD

     SYSOUT=A,OUTPUT=*.NAME1

CREATE MULTIPLE PRINTOUTS WITH DIFFERENT OUTPUT CHARACTERISTICS

//JOBNAME  JOB ….

/OUT1 OUTPUT  DEST=HQS,COPIES=3,FORMS=STDPRT

//OUT2  OUTPUT  DEST=BRNOFE,COPIES=3,FORMS=UPDATE

//STEP2   EXEC  PGM=A

//DD2   DD  SYSOUT=C,OUTPUT=(*.OUT1,*.OUT2)

 

CODING EXPLICIT AND IMPLICIT REFERENCES

 EXPLICIT REFERENCES

 

//OUT2 OUTPUT  CLASS=H

…….

//DD2 DD SYSOUT=(,),          OUTPUT=*.OUT2

IMPLICIT REFERENCES

 

       Code DEFAULT=YES

       JOB or STREP has a default output JCL statement

 

      //OUT2 OUTPUT DEFAULT=YES

      …….

      //REP2 DD SYSOUT=A

CODING EXPLICIT AND IMPLICIT REFERENCES

//JNAME  JOB , MSGCLASS=A

//WKOUT  OUTPUT DEFAULT=YES, DEST=HQS,FORMS=PQ  

//OUTA  OUTPUT  DEST=LOCAL,FORMS=STD

//STEP2   EXEC  PGM=OUTWRTE

//RPT1  DD SYSOUT=A

//RPT2  DD SYSOUT=A

//STEP2   EXEC  PGM=INWRTE

//RPT3  DD SYSOUT=B,OUTPUT=*.OUTA

//RPT4  DD SYSOUT=B

……..

*  STEP LEVEL DEFAULT=Y OVERRIDES JOB LEVEL

 

GROUPID PARAMETER

      Combines SYSOUT data sets into an output group.

      Data sets are processed together at the same time and location.

      Supported only for JES2 systems.

      Data sets grouped together should have same CLASS & DEST parameters

GROUPID PARAMETER

//OUT2 OUTPUT GROUPID=name

 

      2 to eight alphanumeric or national character

 

GROUPID Parameter

      //job statement

   //name OUTPUT GROUPID=gp1,

   //              Default=yes,DEST=HQS                     //step    EXEC PGM=pgm1

   //REP1  DD SYSOUT=B

   //REP2  DD SYSOUT=B

COMBINE SEVERAL SYSOUT DDS INTO GROUPS

//JOBNAME  JOB , MSGCLASS=A

//WKOUT  OUTPUT  GROUPID=GRP2,  

//                         COPIES=3,FORMS=PQ

//STEP1   EXEC  PGM=OUTWRITE

//OUTA   OUTPUT  DEST=LOCAL,FORMS=STD

//DD1       DD  SYSOUT=A,OUTPUT=(*.OUTA,*.WKOUT)

//STEP2   EXEC  PGM=INWRITE

//OUTB   OUTPUT  DEST=LOCAL,FORMS=222

//DD2       DD  SYSOUT=A,OUTPUT=(*. OUTB,*.WKOUT)

//DD3       DD  SYSOUT=A

COND PARAMETER

Definition

Condition (COND) is a keyword parameter that tests a return code against a test code.

      The result of this test determines if a job or step will be executed or bypassed.

      Format    COND=(tcode,oper)

      tcode=test code, oper = operator

 

 

COND PARAMETER

      If condition is true the step is bypassed.

      Can be coded on JOB or EXEC statements

      If condition in JOB is true the job ends after executing the first step.

      COND  on JOB takes precedence over any EXEC.

      JOB may have only test code and operator.

 

COND PARAMETER

Test code (tcode)

      tcode is numeric and ranges from 0 to 4095.

      Can be system generated numbers or set by programmer. Also called condition code.

      After execution  the value is moved to a special register- RETURN-CODE and can be checked for conditions.

      0=No errors, 4=minor errors, 8/12/16=more serious

COND PARAMETER

Operator (oper) 

      GT, GE, EQ, NE, LT, LE.

      Can code up to 8 tests on one statement.

  

COND PARAMETER

For previously executed step within a JOB

       COND=(tcode,oper,stepname).

      Return code is drawn from the name of the step.

      If step name is not specified, return code from all previous steps will be tested.

COND PARAMETER

Previously executed step within a JOB

       COND=(tcode,oper,stepname).

 

Example :

//JOB2   JOB    ……

//STEP1   EXEC   ……

//STEP2…..

//STEP3   EXEC  PGM=ABC,COND=(4,GT,STEP1)

 

COND PARAMETER

      A previously executed  in-stream or cataloged procedure 

COND=(tcode,oper,stepname.procstepname)

 

COND PARAMETER

COND=(tcode,oper,stepname.procstepname)

 

Example :

//PROC2  PROC

//HRCAL  EXEC …..

//STEP2   EXEC  PROC2

……

//STEP5  EXEC PGM=A,COND=(0,GT,STEP2.HRCAL)

COND PARAMETER

Compound Conditions

Can test for a range of values or multiple steps.

Not for testing multiple conditions on one job step.

Maximum of eight conditions can be coded.

COND=((4,GT),(8,LT))

COND=((0,NE,STEP03),(0,NE,STP04))

 

COND PARAMETER - EVEN and  ONLY

      Unlike JOB , EXEC can have several subparameters

      EVEN and ONLY are used only in the case of abend.

      Can be included along with condition code test or can be coded alone.

      COND=((tcode,oper),EVEN/ONLY)

      COND=EVEN/ONLY (Executes job step even if a program ABENDs/only if an ABEND occurs)

 

Additional features in MVS
4.0 version

      If /Then/Else conditional JCL

      INCLUDING jcl  from a PDS

      SEGMENT, SPIN & CLOSE keyword parameters on DD statement

      Enhancement  in TIME PARAMETER

      New keywords on JOB statement   (BYTES, CARDS, LINES, PAGES)

USING IF / THEN/ ELSE

      This statement is used in JCL for conditions instead of COND parameter.

      //Name IF ( condition or text) THEN

   //  jcl statements to be executed if the            condition met

   //Name ELSE

   // jcl statements to be executed if the             condition is not met

   //Name ENDIF.

 

USING IF / THEN/ ELSE

   //         IF RC = 4 THEN

   //STEP1 EXEC statement

   //         ELSE

   // STEP2  EXEC statement

  //          ENDIF

 

*All mnemonic & character operators are allowed

USING IF / THEN/ ELSE

      //  IF ((RC GE 1) or (RC LT 4))   THEN

   //STEP1  EXEC PGM=pgm1

   //   ELSE

   //STEP2  EXEC PGM=pgm2

   //   ENDIF

      //   IF (STEP1.RC  = 8) THEN

   //STEP3  EXEC PGM=pgm3

   //    ENDIF

 

USING IF / THEN/ ELSE

   //   IF  (STEP1.ABEND = TRUE)  THEN

   //STEP2  EXEC PGM=error

   //    ELSE

   //STEP3  EXEC PGM=pgm3

   //    ENDIF

      RUN, NOT RUN, ABENDCC etc can be used

INCLUDE IN JCL

      We can include JCL’s from other than procedure libraries through INCLUDE statement

        //name JCLLIB ORDER=(PDS1,PDS2)

       //   INCLUDE MEMBER=JCL member 

      Only one JCLLIB name is allowed in a job

SEGMENT ON DD statement

      This allows a portion of a dataset to be printed even though the job is still running & generating output

      //  DD SYSOUT=X,SEGMENT=Value

    where value is no of pages in a segment  

SPIN on DD statement

      This allows an output dataset to be printed at the end of a step or at the end of a job

      //  DD SYSOUT=X,SPIN=Value

       value = UNALLOC or NO

       UNALLOC - the dataset to be printed once that is unallocated

        NO - the dataset is not printed until the end of the job even it is closed

FREE Parameter on DD statement

      This deallocates a dataset when it is closed rather than at the end of a job step

      //  DD SYSOUT=X, FREE=CLOSE

Advantages of FREE Parameter

      A dataset is freed for other program usage as soon as a program has finished using it

      Tape drives are freed for other programs use

      Sysout data can be released for printing before a job has finished

TIME Parameter

   //job card ,TIME=Value

   Value - LIMIT (Min,Sec)

              - NOLIMIT

              - MAX (357912 minutes)

              - 1440 

NEW KEYWORDS ON JOB

      These are used to control the amount of sysout produced by the job

      BYTES

      CARDS

      LINES

      PAGES

      We can also specify an action if the limit exceeds this parameter value

NEW KEYWORDS ON JOB

 //jobname JOB……,LINES=(100,ACTION)

  CANCEL      cancel job without dump

  DUMP           cancel job with dump

  WARNING   continue job but send warning                            messages to the operator                                    

                                                             The End

No comments