Tuesday, 1 January 2013

JCL

1) Introduction to JCL

2) Structure of JCL

3) Parameters

4) Statements in JCL

5) IBM Utilities

6) Procedures

7) GDG

8) Abends

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. sir,can u provide me the brief description about procedures,GDG and abends
    in jcl.

    ReplyDelete
    Replies
    1. Hi Ravindra, Please find description below -

      1) Procedures :
      when same code is used repetitively, then that code is coded seperately either in instream of JCL or as a member of PDS, which can be called in JCL.
      There are two tyes of procedures
      1) Cataloged procedures : Procedures which are saved as member of PDS.

      CATPROC procedure saved in XX7384A.CATPROC.LIB

      //CATPROC PROC
      //STEP1 EXEC PGM=IEFBR14
      //SYSPRINT DD SYSOUT=*
      //SYSOUT DD SYSOUT=*
      //DD1 DD DSN=XX7384A.NEW.PS,
      // DISP=(NEW,CATLG,DELETE),
      // UNIT=SYSDA,
      // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
      // SPACE=(CYL,(2,3))
      //*


      JCL to execute CATPROC procedure -
      //JOB1 JOB
      // JCLLIB ORDER=XX7384A.CATPROC.LIB
      //STEP1 EXEC CATPROC
      //*
      in this JCL CATPROC cataloged proceure is executed.


      2) Instream procedures
      Procedure written instream of JCL is known as Instream procedure.

      //JOB1 JOB
      //INPROC PROC
      //STEP1 EXEC PGM=IEFBR14
      //SYSPRINT DD SYSOUT=*
      //SYSOUT DD SYSOUT=*
      //DD1 DD DSN=XX7384A.NEW.PS,
      // DISP=(NEW,CATLG,DELETE),
      // UNIT=SYSDA,
      // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
      // SPACE=(CYL,(2,3))
      // PEND
      //*
      //STEPX EXEC INPROC
      //*

      Here stepx is executing INPROC procedure.

      Delete
  3. 2) GDG : Generation data groups
    In production there are daily, weekly, quarterly, monthly or yearly running jobs, so in order to take BKUP of data, generally we use GDGs, there is no need to provide different names to datasets when you create, system on it's own will take care of it.

    These datasets are chronologically and functionally similar datasets.

    Note : Under one GDG base datasets can be created with different combination of record length, record formats.

    to create GDG datasets first we need to create GDG base, then GDG dataset can be created.

    1) Create GDG base
    //JOB1 JOB
    //STEP1 EXEC PGM=IDCAMS
    //SYSPRINT DD SYSOUT=*
    //SYSOUT DD SYSOUT=*
    //SYSIN DD *
    DEFINE GDG -
    NAME(XA7384A.GDG.BASE) -
    LIMIT(10) -
    NOEMPTY -
    SCRATCH -
    )
    //*
    This JCL will create GDG base.


    JCL to create GDG dataset
    //JOB 1 JOB
    //STEP1 EXEC PGM=IEFBR14
    //SYSPRINT DD SYSOUT=*
    //SYSOUT DD SYSOUT=*
    //DD1 DD DSN=XX7384A.GDG.BASE(+1),
    // DISP=(NEW,CATLG,DELETE),
    // UNIT=SYSDA,
    // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
    // SPACE=(CYL,(2,3))
    //*

    here +1 indicates new version,
    0 indicates current version
    -1 indicates previous version
    -2 older then -1 and so on....

    Note : GDG dataset will be updated after completion of JCL only.

    ReplyDelete
  4. 3) Abends :
    When JCL/JOB terminates abnormally/unsuccessfully, it is called as job abend. It will give some specific abend code for specific reasons.

    for example :
    1) S322 - Time abend, when sufficient time is not provided to job.
    2) SOC7 - Bad data
    3) SO13 - Member not found
    4) S806 - load module not found
    5) S722 - When there is no space to write ouput in sysout.
    6) S222 - Cancelled by operator

    ReplyDelete