TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

JCL - Statements


There are three important statements in JCL.
  1. JOB

  2. EXEC

  3. DD


JOB Statement:

The job statement or job card must always be the first JCL statement coded for a job.

Three basic functions performed by this statement are as follows:
  1. Identifies a job to MVS and supplies a job name that MVS uses to refer to the job.

  2. Supplies accounting information.

  3. It supplies various options that influence or limit how the job is processed.

Let see format of job statement below,

//Job_name JOB [accounting information] [,programmer name] [,USER=user-id] [,PASSWORD=password]
[,NOTIFY=user-id] [,CLASS=class] [,MSGCLASS=class] [,MSGLEVEL=(stmt,msg)] [,TIME=(mins,secs)]

Example:

//JOBNAME1 JOB (*),"ibmmainframer",CLASS=C,PRTY=10,NOTIFY=&SYSUID,
//   MSGCLASS=X,MSGLEVEL=(1,1),TYPRUN=SCAN,
//   TIME=(3,0),REGION=10K

Here, JOB statement is getting extended beyond the 70th position in a line,so we continue in the next line which should start with "//" followed by one or more spaces.


EXEC Statement:

The EXEC statement identifies each step in a job. This statement holds the job step program/procedure information is the EXEC statement.

Format of an EXEC statement is as follows:

//stepname EXEC PGM=program-name  [,PARM=information] [,COND=([(code,operator,step)][,EVEN/ONLY])

Example:

Following is a simple example of JCL script along with JOB and EXEC statements:

//JOBNAME2 JOB 'ibmmainframer',CLASS=C,MSGCLASS=X,REGION=8K,
//      NOTIFY=&SYSUID
//*
//STEP001 EXEC PGM=MYCOBOL,PARAM=CUST1000,
//      ACCT=(XXXX),REGION=8K,ADDRSPC=REAL,TIME=1440

DD Statement:

The DD statements are used to define the datasets.
  • It describes the data sets that are used by the program.

  • We can code one DD statement for each data set.

  • Always code the DD statements after the EXEC statement that identifies the job step.

  • DD statements are the most complicated of the JCL statements.
There three formats of DD statements as below,
  1. DD statement for DASD data sets

    //DDNAME DD DSNAME=data-set-name,
    // DISP=(status,normaldisp,abnormal-disp)
    // [,UNIT=unit]
    // [,VOL=SER=vol-ser]
    // [,SPACE=unit,(primary,secondary,dir)]
    // [,DCB=(option,option)]
  2. DD statement for In-stream data sets

    //DDNAME DD *
    // [, DLM=XX]
  3. DD statement for SYSOUT data sets

    //DDNAME DD SYSOUT=*

Example:

Following is an example, which makes use of DD statements along with various parameters explained above:

//JOBNAME3 JOB 'ibmmainframer',CLASS=C,MSGCLASS=X,REGION=8K,
//         NOTIFY=&SYSUID
//*
//STEP010  EXEC PGM=ICETOOL,ADDRSPC=REAL
//*
//INPUT1   DD DSN=userid.SORT.INPUT1,DISP=SHR
//INPUT2   DD DSN=userid.SORT.INPUT2,DISP=SHR,UNIT=SYSDA,
//         VOL=SER=(1243,1244)
//OUTPUT1  DD DSN=userid.SAMPLE.OUTPUT1,DISP=(,CATLG,DELETE),
//         RECFM=FB,LRECL=80,SPACE=(CYL,(5,2))
//OUTPUT2  DD SYSOUT=*

Video Tutorial: JCL Statements



In next chapter, We will discuss about each JCL statements and it's parameters in detail...


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal