Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Table of Contents.
1.
2.
3.
4.
5.
6.
Introduction--------------------------------Job,exec,DD statements
Procedures
Conditional Processing
Jcl Utilities
Abend Handling.
1. Introduction.
What is JCL?
Job Control Language (JCL) is a means of communication between an application program
and the computer's operating system. It is a set of control statements that provide the
specifications necessary to process a JOB.
A Job is nothing but the execution of one or more related programs in sequence. Each
program to be executed by a job is called a Job Step.
Sample JCL.
//First JOB (034D),'RAMESH', CLASS=S,PRTY=6
JOB Statement
Program Name
Step Name
// DISP=SHR
//OUTPUT DD DSN=REPORT.FILE,
// DISP=(NEW,CATLG,DELETE)
// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80),
// SPACE(TRKS,(100,20),RLSE)
//SYSOUT DD SYSOUT=*
Time: Specifies the time span to be used by the processor to execute the job.
When TIME coded for both JOB and STEP ,TIME coded for a step applies to that
step, and time coded in job applies for whole job such that both are satisfied.
Following is the syntax:
TIME=(mm, ss) or TIME=ss. mm is in minutes , ss is in seconds.
Region : Specifies the address space required to run a job step within the job.
Region in JOB overrides that of EXEC. Following is the syntax: REGION=nK | nM.
n = number, M = megabyte , K = kilobyte
Typerun =Scan|Hold : Scan is used to check syntax error without executing it.
Hold is used to put a job on hold and can be released by
typing A against the job in spool.
RESTART and COND: These are used in conditional job step processing. when
COND coded in both JOB and EXEC, JOB COND is ignored.
NB: CLASS,MSGCLASS,REGION,PRTY are sensitive parameters and are
project specific. They should not be altered without prior permission.
2.2 EXEC:
2.3 DD STATEMENTS.
The definition of each dataset used in the JCL is given using the DD
statement. The input and output resources required by a job step needs
to be described within a DD statement with information such as the
dataset organisation, storage requirements and record length.
Syntax:
//DD-name DD Parameters
DISP:
OLD The dataset exists and this job step has exclusive use of the dataset.
SHR The dataset exists and other users and jobs can access the dataset, this is the
default
MO
D
NE
W
The dataset should be kept and new records will be appended to the end of the
dataset. The dataset may or may not exist. If it does not exist then a data set will
be created.
The dataset does not exist and will be created.
Normal Disposition:
CATLG
Places the entry in the system catalog or user catalog. For a NEW data set
this is the default.
UNCAT
Deletes the entry from the system catalog or user catalog.
LG
Abnormal Disposition:
DELETE Indicates that the data set is to be deleted at the end of a job step.
KEEP
CATLG
UNCAT Indicates that the system is to delete the entry in the system or user
LG
catalog.
DCB: The Data Control Block (DCB) parameter details the physical
characteristics of a dataset. This parameter is required for datasets
that are newly created in the job step.
LRECL: It is the length of each record held within the dataset.
RECFM: It is the record format of the dataset. RECFM can hold
values FB, V or VB.
BLKSIZE: It is the size of the physical block.
DSORG: is the type of dataset organisation. DSORG can hold values
PS (Physical Sequential), PO (Partitioned Organisation) and DA
(Direct Organisation).
Example:
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DIRBLKS=1)
sec: This is the additional space required, when the primary space is not
being sufficient.
ir: This is the directory blocks required, if the dataset is a PDS (Partitioned
Dataset) with members within it.
RLSE: This is used to release the unused space at job completion.
3. PROCEDURES:
The JCL Procedures are set of statements inside a JCL grouped together to
perform a particular function. Usually, the fixed part of the JCL is coded in a
procedure. The varying part of the Job is coded within the JCL.
Syntax:
Types of procedure:
3.1 Instream Procedure.
When the procedure is coded within the same JCL member, it is called an
Instream Procedure. It should start with a PROC statement and end with a
PEND statement.
3.2 Catalogued Procedure:
When the procedure is separated out from the JCL and coded in a different
data store, it is called a Cataloged Procedure. A PROC statement is not
mandatory to be coded in a cataloged procedure.
3.3
Nested Procedure.
Calling a procedure from within a procedure is called a nested
procedure. Procedures can be nested up to 15 levels. The nesting can be
completely in-stream or cataloged. We cannot code an instream
procedure within a cataloged procedure.
Example:
//SAMPINST JOB 1,CLASS=6,MSGCLASS=Y,NOTIFY=&SYSUID
//*
//SETNM
SET DSNM1=INPUT1,DSNM2=OUTPUT1
//INSTPRC1 PROC
//* START OF PROCEDURE 1
//STEP1
EXEC PGM=SORT,DISP=SHR
//SORTIN
DD DSN=&DSNM1,DISP=SHR
//SORTOUT
DD DSN=&DSNM2,DISP=(,PASS)
//SYSOUT
DD SYSOUT=*
//SYSIN
DD DSN=&DATAC
//*
//STEP2
EXEC PROC=INSTPRC2,DSNM2=MYDATA.URMI.OUTPUT2
//
PEND
//* END OF PROCEDURE 1
//*
//INSTPRC2 PROC
//* START OF PROCEDURE 2
//STEP1
EXEC PGM=SORT
//SORTIN
DD DSN=*.INSTPRC1.STEP1.SORTOUT
//SORTOUT
DD DSN=&DSNM2,DISP=OLD
//SYSOUT
DD SYSOUT=*
//SYSIN
DD DSN=&DATAC
//
PEND
//* END OF PROCEDURE 2
//*
//JSTEP1 EXEC INSTPRC1,DSNM1=MYDATA.URMI.INPUT1,
//
DATAC=MYDATA.BASE.LIB1(DATA1)
//*
In the above example, the JCL calls the procedure INSTPRC1 in JSTEP1 and
procedure INSTPRC2 is being called within the procedure INSTPRC1. Here,
the output of INSTPRC1 (SORTOUT) is passed as input (SORTIN) to INSTPRC2.
A SET statement is used to define commonly used symbolic across job steps or
procedures. It initializes the previous values in the symbolic names. It has to be defined
before the first use of the symbolic names in the JCL.
4. Conditional Processing.
5. JCL Utilities
6. Abend Handling