EXECUTE JCL FOR COBOL + Mainframe

July 11, 2008

000001 //RUNCOB JOB ‘LEM01′,’MAC’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
000002 //STEP1 EXEC PGM=COBOL <= OBJ PRM NAME
000003 //STEPLIB DD DISP=SHR,DSN=IBMMFS.MAC.LOAD <= LOAD MODULE PDS
000004 //JCLFILE DD DISP=SHR,DSN=IBMMFS.MAC.PSFILE <=COBOL QSAM FILE-ID
000005 //SYSPRINT DD SYSOUT=* <= OUTPUT STREAM ( * = X )
000006 //SYSIN DD * <= INPUT STREAM
000007 25
000008 /*
000009 //


COMPILE AND RUN JCL FOR COBOL

July 11, 2008

****** ***************************** Top of Data **************************************
000001 //COBCOMP JOB ‘IBMMFS’,'MAC’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID

000002 //PROCLIB JCLLIB ORDER=IBMMFS.PROC.COBOL   <= CONTAINS IGYWCL
000003 //STEP1 EXEC IGYWCL,
000004 // PARM.COBOL=’LIB,APOST,XREF,MAP,OFFSET’    <= COMPILER OPTIONS
000005 //COBOL.SYSIN DD DISP=SHR,DSN=IBMMFS.MAC.SOURCE(COBOL) <= I\P PGM
000006 //LKED.SYSLIB DD DISP=SHR,DSN=IBMMFS.MAC.COPY(SUBCOB) <= COPYLIB
000007 //LKED.SYSLMOD DD DISP=SHR,DSN=IBMMFS.MAC.LOAD(COBOL) <= O\P PGM
000008 //SYSPRINT DD SYSOUT=*
000009 //
****** **************************** Bottom of Data ************************************


MAINFRAME CODE – JCL

July 7, 2008

//OZA195Z JOB OZA,’ROHIT’,MSGCLASS=A,MSGLEVEL=(1,1),CLASS=A,
copy ps

// NOTIFY=&SYSUID,PRTY=10,TIME=(1,1),REGION=0M
//STEP20 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//*SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=OZA195.TEST1.DATASET,DISP=SHR
//SYSUT2 DD DSN=OZA195.TEST.COPY.HYD,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0,DSORG=PS)
//SYSIN DD DUMMY
//

COPY PDS
//OZA195Y JOB OZA,’ROHIT’,MSGCLASS=A,MSGLEVEL=(1,1),CLASS=A,
// NOTIFY=&SYSUID,PRTY=10,TIME=(1,1),REGION=0M
//STEP20 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//*SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=OZA195.TEST.PDS,DISP=SHR
//SYSUT2 DD DSN=OZA195.TEST.C.PDS,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1,18),RLSE),UNIT=SYSDA,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0,DSORG=PO)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
//

SORT PS
//OZA195S JOB OZA,OZA,MSGLEVEL=(1,1),TIME=(5,5),
// CLASS=A,MSGCLASS=A,NOTIFY=OZA195
//***************************************************
//*KEEP USERID IN PLACE OF OZAXXX IN JOBNAME OZAXXXRP
//*SAMPLE JCL REPRO/COPY DATA FROM PS TO VSAM
//***************************************************
//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=OZA195.TEST1.DATASET,DISP=SHR
//SORTOUT DD DSN=OZA195.TER9.DATASET.NEW2,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// DCB=(LRECL=10,BLKSIZE=8000,RECFM=FB),
// SPACE=(CYL,(10,20),RLSE)
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=NONE
/*

copy ps using IDCAMS
//OZA195Y JOB OZA,’ROHIT’,MSGCLASS=A,MSGLEVEL=(1,1),CLASS=A,
// NOTIFY=&SYSUID,PRTY=10,TIME=(1,1),REGION=0M
//STEP20 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO -
INDATASET(OZA195.SORT.DATASET)-
OUTDATASET(OZA195.SORT.DATASET.COPY)
/*
//


007 – Introduction to JCL – SPECIAL DD STATEMENTS

July 4, 2008

SOURCE – http://www.geocities.com/srcsinc/drona/programming/languages/jcl/jcl.html

SPECIAL DD STATEMENTS

1. DUMMY DSN=NULLFILE

2. Concatenating Data sets

3. Passing data to cobol program using – SYSIN DD *

4. SYSOUT

5. SYSUDUMP

6. SYSADUMP

1. DUMMY or DSN=NULLFILE

Some times we need to testing of program, without using actual datasets. Then we can use DUMMY or DSN=NULLFILE. If we use DUMMY, operating system simulates the presence of a file. When you reading Operating system sends end of file request to program.

Example JCL –>

//MYJOB JOB (W345),’KRISHNA REDDY’

//STEP1 EXEC PGM=COBPROG

//INFILE DD DUMMY

2. CONCATENATING DATA SETS

In JCL , we can concatenate different files by giving their name one after another. All data sets concated must be of the same type. For example, partitioned data sets can be concatenated only with partitioned data sets.

Example JCL –>

//MYJOB JOB (W345),’KRISHNA REDDY’

//STEP1 EXEC PGM=COBPROG

//INFILE DD DSN=TEST.GLOB.FILE1

// DSN=TEST.GLOB.FILE2

// DSN=TEST.GLOB.FILE3

In program , we will read it as an single file. concatination of three files done by operating system.

Maximum of 255 sequential data sets can be concatenated together
Maximum of 16 partitioned data sets can be concatenated together

3. PASS DATA TO COBOL PROGRAM USING – SYSIN DD *

This is the one of the way of passing data to program. There are two syntax’s to pass data.

Syntax1 ->

//MYJOB JOB (W234),’RAMESH’

//STEP1 EXEC PGM=COBPROG

//SYSIN DD * /*

Syntax2 ->

//MYJOB JOB (E345),’KRISHNA REDDY’

//STEP1 EXEC PGM=COBPROG

//SYSIN DD DATA /*

4. SYSOUT

The SYSOUT parameter is used to send the output which is generated during job execution.

Syntax ->

//ddname DD SYSOUT=class

EXAMPLE JCL ->

//MYJOB JOB (R456),’KRISHNA REDDY’

//STEP1 EXEC PGM=COBPROG

//INFILE DD SYSOUT=A

In this example, COBPROG is executed and all generated outputs are directed to class ( here it is letter A)

If * used with SYSOUT (SYSOUT=*) parameter, The class assigned to the MSGCLASS parameter will be used to SYSOUT.

5. SYSUDUMP

SYSUDUMP is used to dump the content of various registers, variables and datasets acccessed at the time of abnormal termination, into a dataset. The dump is in hexadecimal.

Syntax –> //SYSUDUMP DD …..

EXAMPLE JCL –>

//MYJOB JOB (W345),’RAMESH’

//STEP1 EXEC PGM=COBPROG

//SYSUDUMP DD DSN=TEST.PROD.LIB

6. SYSABEND

SYSABEND is used to dump the contents of various registers variables , datasets accessed and The nucleus at the time of abnormal termination. The dump is in hexadecimal.

Syntax –> //SYSABEND DD …..

EXAMPLE JCL –> //MYJOB JOB (WE345),’KRISHNA REDDY’

//STEP1 EXEC PGM=COBPROG


006 – Introduction to JCL – DD Statement

July 4, 2008
SOURCE - http://www.geocities.com/srcsinc/drona/programming/languages/jcl/jcl.html

DD STATEMENT

The DD statement (Data Definition), is used to identify the source of input
and the placement of output information

Syntax  ->  //ddname  DD  < positional / keyword parameters >

            ddname must be unique in the job

            Positional parameters -  *
                                     DATA
                                     DUMMY
                                     DYNAM

            Keyword Parameters   -   DSN
                                     DISP
                                     UNIT
                                     SPACE
                                     DCB
                                     VOLUME   

DSN PARAMETER 

    DSN parameter is used specify the data set name

    Syntax  ->  DSN=dataset name

    Example JCL ->  //MYJOB   JOB   (ER3),'RAMESH R'
                    //STEP1   EXEC  PGM=COBPROG
                    //INFILE  DD    DSN=TEST.GLOB.MYLIB

                    TEST.GLOB.MYLIB will be used in the COBPROG program.

TEMPORARY DATA SETS

    Temporary data set is created during job and deleted at the end of the job.  

    Temporary data set can be coded by using two ampersands followed by name.

    Example JCL  --> //MYJOB   JOB   (E456),'RAMESH'
                     //STEP1   EXEC  PGM=COBPROG
                     //INFILE  DD    DSN=&&TEMP         

    Here TEMP is an temporary dataset will be deleted upon job completion.

DISP PARAMETER

   The DISP parameter is used specify the disposition of dataset which is
   coded on DSN parameter. 

   Syntax   ->      

                  

   Parameter on the DISP statement

         Status                   Normal Disposition           Abnormal Disposition

         NEW                      DELETE                       DELETE
         OLD                      CATLG                        CATLG
         MOD                      UNCATLG                      KEEP
         SHR                      KEEP                         UNCATLG
                                  PASS 

    STATUS  

          NEW  -  Dataset will be created. (file should not exists)
          OLD  -  Dataset should exists.
          MOD  -  Dataset will be created If not exists.
          SHR  -  Dataset can be used by other jobs also

    NORMAL DISPOSITION
    (Happened upon sucessful execution of job step)

          DELETE  -  Dataset should be deleted
          CATLG   -  Dataset will be cataloged
          UNCATLG -  Dataset will be removed from system catalogs
          KEEP    -  Dataset will be retained (This parameter should
                     be used with permanent data sets)
          PASS    -  Dataset is to be passed subsequent job step in
                     the same job

    ABNORMAL DISPOSITION
    (Happened upon unsucessful execution of job step)

          DELETE  -  Dataset should be deleted
          CATLG   -  Dataset will be cataloged
          UNCATLG -  Dataset will be removed from system catalogs
          KEEP    -  Dataset is to be kept

    EXAMPLE JCL -->   //MYJOB   JOB   (E674),'KRISHNA REDDY'
                      //STEP1   EXEC  PGM=COBPROG
                      //INFILE  DD    DSN=TEST.GLOB.TEMP,
                      //              DISP=(NEW,CATLG,DELETE)

    In this example , 

          DISP=(NEW,CATLG,DELETE)

          NEW    - TEST.GLOB.TEMP is not exists, it will be created

          CATLG  - Upon successful execution of job step, data set
                    will be cataloged

          DELETE - If job terminicated abnormally, dataset will be deleted

UNIT PARAMETER

    In IBM Mainframe environment, All devices have an address assigned to
    them at the time they added to the sytem. Devices can be referenced
    using this addresses. UNIT parameter is used to specify thise address.

    Syntax  ->   UNIT=device_address/device_type/device_group_name/TAPE

    EXAMPLE JCL -> //MYJOB  JOB   (R345),'KRISHNA REDDY'
                   //STEP1  EXEC  PGM=COBPROG
                   //INFILE DD    DSN=TEST.GLOB.TEST.LIB,
                   //             UNIT=SYSDA

    In above example, COBPROG is executed, and a file INFILE  which may
    reside on any of the devices  which are grouped under the symbolic name
    SYSDA will be accessed

VOL PARAMETER

    This parameter is used to identify the volume serial number on which
    dataset is reside. The VOL dataset is used with disk and tape datasets.

    Syntax  ->   VOL= volumelabel/data set label  

    Sub parameters used with VOL parameter

        SER     -  Specification of serial number
        REF     -  Referencing VOL specification from a prior step
        PRIVATE -  Allowing access to volume by single user
        RETAIN  -  Inhibiting dismounting of volume until end of job
        SEQ     -  Specification of sequence in which volumes are to be mounted

    EXAMPLE JCL -->  //MYJOB   JOB   (E454),'KRISHNA REDDY'
                     //STEP1   EXEC  PGM=COBPROG
                     //INFILE  DD    DSN=TEST.GLOB.TEMP,
                     //              VOL=SER=(VOL1,VOL2,VOL3)

    In this example the data set called DATA3 resides on 3 volumes whose
    serial numbers are VOL1,VOL2,VOL3. The Operating system will request
    that all volumes be mounted at the same time.

SPACE PARAMETER

     The SPACE parameter is used to allocate space for datasets.
     We can allocate space in Cylinders/Tracks/Blocks

     Syntax  ->  SPACE=(CYL,(primary,secondary,directory),RLSE,CONTIG,MXIG,ROUND)

                 Instead of CYL, We can use TRK or BLK

     Meaning of Sub Parameter 

             TRK       -  Requesting space in track

             CYL       -  Requesting space in cylinders

             PRIMARY   -  Primary storage to be allocated at the time of
                          data set created

             SECONDARY -  Additional storage to be allocated ,
			              If primary storage is not sufficient

             DIRECTORY -  Space for recording of name and location of partitioned
                          data sets

             RLSE      -  Request for release of space previously allocated unused
                          space after completion of job

             CONTIG    -  Request for contiguous space

             MXIG      -  Request for large aread of contiguous space

             ROUND     -  Request for entire cylinder for storage of data set

      EXAMPLE JCL  ->   //MYJOB   JOB   (W345),'KRISHNA REDDY'
                         //STEP1   EXEC  PGM=COBPROG
                         //INFILE  DD    DSN=TEST.GLOB.LIB
                         //              UNIT=4560
                         //              SPACE=(CYL,(30,4))

      In this example, 30 cylinders are requested as primary space and 4
      additional cyliders as secondary space.
Upto 15 extends of secondary space ( in our example it is 4 ) will be alloted , If space is not sufficient.
DCB PARAMETER Records in dataset may contain FIXED length / VARIABLE length. The DCB (Data Control Block) parameter is used to specify record format,record length, block size etc.. Syntax -> //ddname DD DCB=< parameters > Subparameters in DCB RECFM - Specification of record format - F/FB/V/VB/U LRECL - Specification of record length BLKSIZE - Specification of block size BUFNO - Specification of buffers EXAMPLE JCL -> //MYJCL JOB (E3445),'RAMESH' //STEP1 EXEC PROG=COBPROG //INFILE DD DSN=TEST.GLOB.LIB // UNIT=234, // DSN=(LRECL=80, // RECFM=FB, // BLKSIZE=800, // BUFNO=30) In this example, The DCB parameter specifies that this file is to have a logical record length of 80 bytes, it will have a fixed block record format, and the block will 800 (800 is multiple of 80). The BUFNO parameter is set to 30, indicating upto 30 buffers may be utilized in virtual storage for this data set. Default buffers are 5,if you not specified any thing
When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

005 – Introduction to JCL – PARAMETERS IN BOTH STATEMENTS (JOB and EXEC)

July 4, 2008
SOURCE - http://www.geocities.com/srcsinc/drona/programming/languages/jcl/jcl.html

PARAMETERS IN BOTH STATEMENTS (JOB and EXEC)

COND  REGION  TIME 

These parameters can code in both JOB and EXEC statements, When we code
these parameters on both statement, 

JOB - REGION     will override     EXEC - REGION

JOB - COND       will override     EXEC - COND

EXEC - TIME      will overrirde    JOB - TIME

Now let us see details of these parameters

REGION - Specifies the amount of space should be used at the time of
         running a job/step

         Syntax  ->      REGION=< value >K
                              or
                         REGION=< value >M

         Example JCL -> //MYJOB  JOB   (AE32),'RAMESH'
                        //STEP1  EXEC  PGM=COBPROG,
                        //            REGION=67K
All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M
COND - Each step sends an a return code to the system upon completion. This is called condition code. COND parameter is used to control the execution of subsequent job steps, depending on the condition code that is returned for prior step. Return code number between 0 and 4095 Syntax -> COND=(comparsion-code,condition) (If coded on job) COND=(comparsion-code,condition [,stepname] [,EVEN / ONLY]) (If coded on step) condition can be GT,GE,LT,LE,EQ,NE Example JCL -> COND coded on JOB //MYJOB JOB (R475),'KRISHNA REDDY' // COND=(4,GT) //STEP1 EXEC PGM=COBPROG //STEP2 EXEC PGM=COBPROG2 In this example we are specifing that if the number 4 is grater than the return code of STEP1, then STEP2 is to be bypassed. It is elaborated further in the following image COND coded on EXEC statement //MYJOB JOB (U769),'KRISHNA REDDY' //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=COBPROG, // COND=(8,EQ,STEP1) // In this example the COND parameter is used to specify that STEP2 should be by passed if 8 is equal to the return code issued by STEP1. TIME - The time parameter is used to specify the amount of CPU time that a job or job step is permitted to utilize. Syntax -> TIME=minutes OR TIME=([minutes] [,seconds]) minutes can be between 1 and 1439 seconds can be between 1 and 59 Example JCL -> If coded on JOB //MYJOB JOB (E234),'RAMESH KRISHNA',TIME=(20,30) //STEP1 EXEC PGM=COBPROG1 //STEP2 EXEC PGM=COBPROG2 //STEP3 EXEC PGM=COBPROG3 In this example 20 minutes 30 seconds time alloted to job. All steps in this job STEP1 STEP2 STEP3 should complete its task within 20 min. 30 sec. If coded on STEP //MYJOB JOB (R567),'KRISHNA' //STEP1 EXEC PGM=COBPRO // TIME=30 In this example 30 min. time is alloted to STEP1. If STEP1 requires more than 30 min. MYJOB will terminate abnormally. If coded on both STEP AND JOB //SECOND JOB ,'R. KRISHNA',TIME=3 //STEP1 EXEC PGM=C,TIME=2 //STEP2 EXEC PGM=D,TIME=2 In this example, the job is allowed 3 minutes of execution time. Each step is allowed 2 minutes of execution time. Should either step try to execute beyond 2 minutes, the job will terminate beginning with that step. If STEP1 executes in 1.74 minutes and if STEP2 tries to execute beyond 1.26 minutes, the job will be terminated because of the 3-minute time limit specified on the JOB statement.
By coding TIME=1440 or TIME=NOLIMIT, It will give a job or step an unlimited amount of time.
To allow a job or step to use the maximum amount of time, code TIME=MAXIMUM. Coding TIME=MAXIMUM allows the job or step to run for 357912 minutes. (Approx. 248 days)

004 – Introduction to JCL – EXEC Statement

July 4, 2008
Source - http://www.geocities.com/srcsinc/drona/programming/languages/jcl/jcl.chapter4.html

EXEC statement

EXEC statement is used to execute a program/procedure

A maximum of 255 EXEC statement can code in an single job

Syntax  - //stepname EXEC PGM=program-name,keyword parameters

            Positional parameter  -  Program-name

Keyword parameters for EXEC

            PARM  ACCT ADDRSPC DPRTY PERFORM RD

PARM

          PARAM parameter is used to pass information to program

          Syntax  ->  PARM=value

                      Value is a string can be 1 to 100 characters long.

         PASSING PARAMETER USING PARM PARAMETER

         

         PARM-INDICATOR will contain "RAMESH"

         PARM-LENGTH contains length of string.             

Remaining parameters , We wont use much     

ACCT    - accounting information for that step

ADDRSPC - used to indicate to the system that the job step is use either
          virtual or real storage

DPRTY   - used to assign priority to the job step

PERFORM - specifies the rate at which system resources used by job step

RD      - restart definition is used to specify automatic restart of a job
          if it abends
Q. If there is a situation, where we need to code more than 255 steps in a JOB?
A. We need to split jcl into two jcls , at the end of the first jcl check the condition
code and initiate the second jcl.


003 – Introduction to JCL – JOBLIB / STEPLIB

July 4, 2008

SOURCE – http://www.geocities.com/srcsinc/drona/programming/languages/jcl/jcl.html

JOBLIB

It is a DD (Data definition) statement, and it specifies where the program (which is specified in EXEC statement) exists. It is applicable to all job steps in that job. It cannot be used in cataloged procedures.

Syntax -> //JOBLIB DD DSN=dataset

EXAMPLE JCL ->

//MYJOB JOB (E343),’KRISHNA’

//JOBLIB DD DSN=SE.TEST.LOADLIB,DISP=SHR <— Attention

//STEP1 EXEC PGM=COBPROG

Immediately following the JOB statement is the JOBLIB DD statement. This is used to specify the location of the program that is to be executed.

STEPLIB

It is also like JOBLIB. It is used to tell in which dataset program resides, It will be coded in JOB STEP. It is only for that step instead of entire JOB. It can be placed any where in the job step. STEPLIB can be coded in cataloged procedures.

Syntax -> //STEPLIB DD DSN=dataset

Example JCL ->

//MYJOB JOB (U456),’KRISHNA’

//STEP1 EXEC PGM=COBPROG

//STEPLIB DD DSN=TEST.MYPROD.LIB,DISP=SHR

//STEP2 EXEC PGM=COBPROG2

//STEPLIB DD DSN=TEST.MYPROD.LIB1,DISP=SHR

In above example, STEP1 is executing COBPROG which is member of TEST.MYPROD.LIB STEP2 is executing COBPROG2 which is member of TEST.MYPROD.LIB1

If both the JOBLIB and STEPLIB statements are coded, then the STEPLIB specification will override JOBLIB specification.

002 – Introduction to JCL – JOB Statement

July 4, 2008
SOURCE - http://www.geocities.com/srcsinc/drona/programming/languages/jcl/


Now let us look at JOB statement

Syntax of JOB Statement



EXPLANATION to keyword parameters

CLASS  PRTY  MSGCLASS  MSGLEVEL  TYPRUN  NOTIFY

1. CLASS - Some jobs can be short running, some jobs may take more time other
           may use havy resources. CLASS keyword parameter is used to tell to
           OS about the nature of job we are submitting.

   Syntax        ->  CLASS=jobclass  

   Valid values  ->  Any alpha betical character between A - Z  or
                     numbers between 0 - 9   

   Example JCL   ->  //MYJOB JOB (3345Y),'KRISHNA REDDY',CLASS=K

2. PRTY  - It is related to CLASS parameter. It assigns priority to jobs which
           belong to the same class. Higher number takes precedence over the
           job with lower number. A job with priority of 12 will run before a
           job with priority 5.

   Syntax        ->  PRTY=priority

   Valid values  ->  Any value between 0 to 15

   Example JCL   ->  //MYJOB JOB (345Y),'KRISHNA REDDY',CLASS=8,PRTY=6 

3. MSGCLASS - The MSGCLASS parameter determines the output device to which
              system messages and JCL messages are written

   Syntax        ->  MSGCLASS=output-class-name

   Valid values  ->  Any alpha betical character between A - Z  or
                     number between 0 - 9   

   Example JCL   ->  //MYJOB JOB (456Y),'KRISHNA REDDY',CLASS=7,PRTY=5,MSGCLASS=A

4. MSGLEVEL - is used to tell JCL, which messages to be printed in the device
              specified in MSGCLASS parameter

   Syntax        ->  MSGLEVEL=(statements,messages)

   Valid values  ->  Statements may be the number 0,1,2 and messages can be 0 or 1

                     STATEMENT
                     0  -  Related to job statements only printed
                     1  -  jcl will be printed
                           (which includes all cataloged/symbolic parameters)
                     2  -  only the input jcl statements being printed

                     MESSAGES
                     0  -  Allocation/termination messages will be printed
                           If job terminates abnormally
                     1  -  Allocation/termination messages will be printed
                           regardless of whether the job terminates normally or
						   abnormally.

    Example JCL  -> //MYJOB JOB (3456Y),'SR',CLASS=8,MSGCLASS=S,MSGLEVEL=(1,1)

5. TYPRUN - The TYPRUN parameter is used to specify whether job is to be held
            until further notice or for syntax checking

    Syntax        ->  TYPRUN=HOLD  -  Job held until further notice
                                or
                     TYPRUN=SCAN  -  Check Jcl for syntax checking

    Example JCL  ->  //MYJOB JOB (3456Y),'KRISHNA',CLASS=8,PRTY=9,TYPRUN=HOLD

6. NOTIFY - The NOTIFY parameter is used to direct the system, where it has to
            send the success/failure message after completing the job.

    Syntax        ->  NOTIFY=userid/&SYSUID

    EXAMPLE JCL  ->  //MYJOB JOB (3456Y),'KRISHNA REDDY',CLASS=8,NOTIFY=&SYSUID

                     &SYSUID - the userid from which user it has been submited 

                     //MYJOB JOB (34W5),'KRISHNA REDDY',CLASS=8,NOTIFY=ERT54

                     It send the sucess/failture message to ERT54 userid

001 – Introduction to JCL

July 4, 2008
SOURCE - http://www.geocities.com/srcsinc/drona/programming/languages/jcl/

INTRODUCTION

Job control language. It is a means of communication between a program that
can be written in COBOL , ASSEMBER or PL/I and the MVS operating system. Without
a JCL, you cant able to run a job on MVS operating system.

Let us start with an example jcl, how it looks like, The following jcl is
used to run an cobol program. I will explain in this chapter each and every
line of this jcl. If you are already fimiliar with jcl, please skip first
6 chapters. 

(First 1 - 6 chapters intended for beginners)

JCL , used to run a cobol program

//JOB1    JOB  (034D),'RAMESH',CLASS='A',PRTY=6
//STEP01  EXEC PGM=COBPROG.
//INFILE  DD   DSN=SED.GLOB.DES.INFILE,DISP=SHR
//OUTIFLE DD   DSN=SED.GLOB.DES.OUTFILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=DISK,
//             SPACE=(CYL,(1,5),RLSE),
//             DCB=(RECFM=FB,LERECL=70,BLKSIZE=700)

to see source code of cobol program COBPROG click here

Now let us discuss JCL which we have seen.

Before explaining, I will explain few basics about JCL

All JCL statements can consists of up to five types of
fields

  // The two forward slashes are required at the beginning of each
     JCL statement in Columns 1 and 2.

  Name field - This is an optional field. If coded, should start at
               Column 3. It maximum length is 8.

  Operation field - Which indicates the operation that is to be performed

  Operand - This field must appear after Operation field. Must start at 16
            column 

  Comments - Comments begin one space after the last operand. Our simple
             example has no comments.

  //  Name    	 Operation             OPerand

  //  JOB1           JOB                  (034D),
                                          'RAMESH',
                                          CLASS='A',
                                          PRTY=6

  //   STEP01         EXEC                PGM=COBPROG

  //   INFILE         DD                  DSN=SED.GLOB.DES.INFILE,
                                          DISP=SHR
  //   OUTIFLE        DD                  DSN=SED.GLOB.DES.OUTFILE,
  //                                      DISP=(NEW,CATLG,DELETE),
  //                                      UNIT=DISK,
  //                                      SPACE=(CYL,(1,5),RLSE),
  //                                      DCB=(RECFM=FB,
  //                                      LERECL=70,BLKSIZE=700)   

  The following image explain How our JCL will execute cobol program

    

  EXPLANATION -

  //JOB1 JOB    (034D),'RAMESH',CLASS='A',PRTY=6

  job card is mainly used to identify job, and tell to MVS about type of job
  it is, priority it has.

  JOB1 is the job name
  034D is accounting information
  RAMESH is name of the programmer
  CLASS is category of job
  PRTY is priority in the class

  //STEP01 EXEC PGM=COBPROG

  EXEC is used to specify the program to be executed. 

  STEP01 is the name of the step (you can give any name here)
  COBPROG is the program name to be executed

 //INFILE DD DSN=SED.GLOB.DES.INFILE,DISP=SHR       

  INFILE is the name of input file, which is used in cobol program

  DSN=SED.GLOB.DES.INFILE - It is dataset contains actual information to be read.

  DISP=SHR - means another program also can read this program while we
             are reading this file.


 //OUTFILE DD DSN=SED.GLOB.DES.OUTFILE,
 //           DISP=(NEW,CATLG,DELETE),
 //           UNIT=DISK,
 //           SPACE=(CYL,(1,5),RLSE),
 //           DCB=(RECFM=FB,LERECL=70,BLKSIZE=700)

 OUTFILE is the name of outputfile, which is used in cobol program

 DSN=SED.GLOB.DES.OUTFILE   is the output file data will be written

 DISP=(NEW,CATLG,DELETE)  Disp specifies the disposition of dataset,

       NEW -  Dataset not exists, need to create
       CATLG - If step executed successfully, dataset should be cataloged
       DELETE - If any error occurred, Dataset should be deleted