Job Control Language: What Is JCL ?

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 66

Job Control Language

What is JCL ?

JCL is a set of control


statements that provide the
specifications necessary to process a
Job.
What is a JOB ?

A JOB means

• Execution of one or more related programs in a


sequence.

• Each program to be executed by a job is called


a Job Step.
Types Of JCL Statement
• JOB
• EXEC
• DD
• PROC
• PEND
• DELIMITER (/*)
• OUTPUT (SYSPRINT)
• COMMENTS (//*)
• MARKS THE END OF A JOB (//)
The Basic JCL Statement that are present in
every JOB are JOB , EXEC , DD.
What is JOB Management ?

• MVS facility that reads and stores Jobs


•Selects Jobs for execution based on relative
importance of each job
• Allocate resources to Jobs as they execute
• Prints the output produced by Jobs.
What is JES ?
• JES stands for Job Entry Subsystem.
• JES is the MVS component that keep track of Jobs that
enter the system.
• Converts the JCL into executable text
• Initiates the job based on the input class, priority etc.
• Allocates data sets and other resources
• Spools outputs to disk
• Releases resources after completion of the job
JOB Scheduler
* Presents the Job for MVS processing
* Sends the Job’s spooled output to the correct destination.
Types
HASP Houston Automatic Spooling Program now
called as JES2.
ASP  Asymmetric Multi-Processing system now called
as JES3.
JCL Basic Coding Format :
JCL statements are coded in 80 byte records.
column Description
1-2 Identifiers
3 – 10 Name Field
12 – 15 Operation Field
17 – 71 Parameters Field
72 Continuation
73 – 80 Sequence Number
Identifier field
Contains ( // , /* , or blank)
Name Field
• Only Eight Alphanumeric or national characters

(Starting with a letter or a national character @,$,#)

Operation Field
• Provides statement’s function ( JOB,EXEC,DD)

Parameter field
What is JOB Statement ?
Job statement identifies a JOB ( a batch unit of
work) to MVS . And supply necessary information.

Kinds of Parameters :
1 . Positional Parameter
2 . Keyword Parameter
Positional Parameter :
* Pre determines Sequence
* Separated by Comma.
* Omitted parameter indicated by successive commas.
Keyword Parameter

* Any sequence permitted.


* Separated by commas.
* Always follows Positional Parameter.

Eg : -
//Job-name <positional parameter>,<keyword parameter>
Positional Parameters :

1. Accounting Information (Max 142 characters)


• This parameter identify the area that the computer time is
to be charged for this Job.
•Format is Installation dependent
•Optional
(account-number,additional-information)

2. Programmers Name (max 20 characters)


• used for user identification
• Specified in single quotes
Keyword Parameters :
* CLASS
• Indicates the type of job submitted to the system.
• Specifies input class for Job Scheduler
• Single alphanumeric character (A-Z, 0-9)
• Different class will represent different types of Jobs and
will depend on installation. (e.g. CLASS=A)
* MSGCLASS
• Assign the job log to a particular SYSOUT class
• Specifies output class for the Job log, List the System
messages, JES2 , MVS operator messages
• Single alphanumeric character (A-Z, 0-9)
• Depends on JES setup
Keyword Parameters :

* MSGLEVEL
• Determines the JCL print & Allocation message
• Format is MSGLVL=(Print,Allocations)
• Print
0  Only Jobs
1  All Input & Procedure Statement
2  Only Input statement
• Allocations
0  no allocation messages
1 all allocation messages
Keyword Parameters :
* PRTY
• Determines priority for scheduling jobs within each class
• Ranges from 0 – 15

* REGION
• Specifies amount of space a Job requires
• Can be specified in KB or MB

* NOTIFY
• Notify the user about the status of the Job
Keyword Parameters :
* TIME
• Specifies maximum CPU time for a Job
• System will automatically cancel the Job if its execution
time exceeds the specified time.
• Format is time=(mins,secs)
* TYPRUN
• Format is TYPRUN=function
• It has two options
1 . Scan 2. Hold
1. Scan  cause JCL to be scanned for syntax error only.
2. Hold  cause the Job to be detained in input queue until
explicitly released by the operator.
Keyword Parameters :
* COND
• Specifies whether a Job should continue to execute or
terminate in relation to the outcome of a job step.
• Format is cond=(code,operator)
code  0 to 4095
operator  GT,GE,EQ,LT,LE,NE
COND=EVEN
Execute this step even if a preceding JOB step
abends.
COND=ONLY
Execute this step only if a preceding JOB step
abends.
Eg.
cond=(0,NE)
JOB will execute only if all Job Steps returns a
condition code of 0.
If True  Terminate the Job
//STEP1 EXEC PGM=ONE
//STEP2 EXEC PGM=A,COND=(0,EQ,STEP1)
//STEP3 EXEC PGM=B,COND=(0,LT,STEP1)
//STEP4 EXEC PGM=C,COND=EVEN
//STEP5 EXEC PGM=D,COND=ONLY
Exec statement :
• Marks the beginning of each step in a JOB.
• Identifies the program or procedure to execute
• Maximum number of Job step in a Job is 255
Step-name:
Every step to be named.
Positional Parameter:
PGM=program (or) PROC=procedure (or) procedure name
Keyword Parameter: (Param,Cond,Time,Region)
• Param
* pass parameter to the program that is being executed
* maximum length of 100 characters
Time Parameter :
If coded on Both JOB and EXEC Statement.
//Job1 Job (A123),’ABC’,Time=12,Notify=&SYSUID
//STEP1 EXEC PGM=A,Time=4
//STEP2 EXEC PGM=B,Time=4
//STEP3 EXEC PGM=C,Time=4
//
Job1 is allowed 12 minutes of CPU time.
STEP1,STEP2,STEP3 are allowed 4 minutes each.If
any one of the steps take more than 4 minutes of CU time,the
Job will terminate normally.
If Time parameter on the Job Card is smaller than it is
on the Job step.Job will terminate.
DD statement:
* Required for each Input/Output file accessed by the
program
* Specifies the name of the Dataset, and their properties
* Up to 3273 DD statements can be allocated to a single
Job Step.
Format is :
//DD-Name DD <Parameters>
Positional Parameter : * , DATA , DUMMY
Keyword Parameter : DSN,DISP,UNIT,SPACE,
DCB,VOLUME
DISP means Disposition:

DISP=(Status,Normal-Disposition,Abnormal-Disposition)
The status field indicates the current status of the data set.

Status Normal- Disp Abnormal-Disp


NEW Delete Delete
OLD Keep Keep
MOD CATLG UNCATLG
SHR UNCATLG CATLG
PASS
UNIT :
The Unit Parameter conveys information about the
input or output devices that will be used by the Job.

Format is :
UNIT=device_address
Or
UNIT=device_type
Or
UNIT=device_group_name
Or
UNIT=AFF=prior_ddname
VOLUME Parameter:

Used to identify specific disk volumes or tapes.

SER Sub_parameter:
VOL=SER=serial_number

Eg :
VOL=SER=SMS005
REF Sub_parameter:
VOL=REF=*.referback(Referback or Backward Reference)
Referback specifies the name of prior DD Statement.
eg . VOL=REF=*.STEP1.DD1
SPACE Parameter :

Allocate storage for new data sets on DASD.


Format :
SPACE=(CYL,(Primary,Secondary,Directory),RLSE,
CONTIG,MXIG,ROUND)

RLSE : Request for release of space previously allocated


CONTIG : Request for contiguous space
MXIG : Request for largest area of contiguous space
Round : Request for entire cylinder for storage of data set.
DCB Parameter : (Data Control Block)
It is used to supply information to the system that
allows it to manage the data sets that are created as jobs are
submitted.

DSORG Specification of what TYPE of Dataset to be


Created. (PS,PO)
RECFM Specification of record format ( F , FB, VB, V,U)
LRECL  Specification of record length
BLKSIZE  Specification of block size
SPECIAL DD STATEMENT :
SYSOUT:Directing system output to a predefined output
class.
SYSPRINT :
• Defines an output file containing messages from IBM
Utility program

Format :
//SYSPRINT DD SYSOUT=*

DUMMY : Specification of dummy data sets.


JOBLIB :
• Used to identify a program library to search first when
attempting to locate programs executed during the job’s life.
• Must be paced after the Job statement and before first Exec
statement in a JOB.
• More than one program library cane concatenated after the
first one on a JOBLIB.
//JOBLIB DD DISP=SHR,DSN=PROGRAM-LIBIRARY
JCLLIB :
• Only one JCLLIB statement is permitted in a JOB,and it
must appear the JOB statement and before first EXEC in a
JOB.
• Used to identify the private libraries.
//UL JCLLIB ORDER=(DSN_NAME1,DSN_NAME2)
STEPLIB:

• The STEPLIB DD statement is used to identify a program


library to search first when attempting to locate programs
executed during the JOB step.
• The STEPLIB can be placed anywhere in the step’s JCL
• If steplib DD is specified in a JOB that also has a joblib,
the steplib takes precedence when searching for a program.

//STEPLIB DD DISP=SHR,DSN=Program-library-name
JOBCAT :
• used to identify a VSAM catalog to search first when attempting to
locate cataloged data sets during the job’s execution
• JOBCAT must be placed after the JOB statement and before the first
EXEC statement in the JOB.
//JOBCAT DD DISP=SHR,DSN=DATALOG-NAME
STEPCAT:
• used to identify a VSAM catalog to search first when
attempting to locate cataloged data sets during the STEP
execution
• STEPCAT can be placed anywhere after EXEC.
• If a STEPCAT DD is specified in a job that has a
JOBCAT,STEPCAT take Precedence.
//STEPCAT DD DISP-SHR,DSN=CATALOG-NAME
CONCATENATING DATA SETS :
Data set names are coded one after the other, all DD
statements appear in the sequence that the data sets are to be
concatenated.
* up to 255 sequential data set can be concatenated together.
* up to 16 partitioned data set can be concatenated together.

SYSUDUMP :
It is used to obtain a dump of the contents of various
registers and variables in case of abnormal termination of
Job. This dump is in hexadecimal.Information about various
subroutines called within the Job and data sets accessed is
also provided.
SYSABEND :

Like SYSUDUMP, It is used to obtain a dump of the


contents of various registers and variables in case of
abnormal termination of Job. This dump is in
hexadecimal,Information about various subroutines called
within the Job and data sets accessed is also provided.In
addition to this, the system nucleus at the time of
termination of a job is also listed to the output device or
data set.
TEMPORARY DATASET :

Dataset can be Temporary or Permanent. It is created during


the job execution and deleted after a Job completion.One
reason for using temporary data sets would be to release
storage utilized by the data set after termination of the JOB.
A temporary data set is also recognized by coding the DSN
parameter and naming the data set as follows:
•Name must start with two ampersand(&&) followed by 1 to
8 characters.
Format :
//Data1 DD DSN=&&Tempdata
REFERBACK:
Reference to an earlier DD statement in the JOB.

Example :
//STEP1 EXEC PGM=PGM1
//DD1 DD DSN=INPUT1.DSN,DISP=OLD,
// VOL=SER=11111
//*
//STEP2 EXEC PGM=PGM2
//DD2 DD DSN=INPUT2.DSN,DISP=OLD,
// VOL=REF=*.DD1
FORWARD REFERENCE:
Reference to a following DD statement in the JOB.

Example :
//STEP1 EXEC PGM=PGM1
//DD1 DD DDNAME=DD3
//DD2 DD DSN=DD2.DSN,DISP=SHR
//DD3 DD DSN=XXX.BBB,DISP=SHR
Utilities:
Utility programs are generalized programs used in
installations to perform common data processing
functions
for example : copying files is a common
function.
* IEFBR14  Null Utility used when creating a PS
or PDS
* IEBGENER  copy data from one PS to another
PS
* IEBCOPY  copy data from one PDS to another
PDS
* IEBCOMPARE  compare two data sets.

* IEHLIST  List the VTOC Information.

* IEHPROGM  Used to catalog or uncatalog DS.

* SORT  used to sort the data and for merging to


files.
TO CREATE A PS OR PDS

//TECH201A JOB (AA),’MANI’,NOTIFY=TECH201,TIME=(,2)


//JSTEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=‘TECH201.JCL.PS1’,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=80,BLKSIZE=800,RECFM=FB),
// UNIT=SYSDA
//JSTEP2 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=‘TECH201.JCL.PDS1’,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(2,1,5)),
// DCB=(DSORG=PO,LRECL=80,BLKSIZE=800,RECFM=FB),
// UNIT=SYSDA
//
TO COPY Content From One PS To another PS

//TECH201A JOB ,'MANE',REGION=6M,CLASS=A,MSGCLASS=H,


// NOTIFY=TECH201
//GENER EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TECH201.JCL.CONCAT
//SYSUT2 DD DISP=(NEW,CATLG),DSN=TECH201.CLASS.EGPSE1,
// SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
//SYSIN DD *
/*
//
TO Copy from one PDS to another PDS
//TECH201A JOB ,'MANE',REGION=6M,CLASS=A,MSGCLASS=H,
// NOTIFY=TECH201
//IEBCOPY EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=MTRG011.PDS.JCLDUMP
//DD2 DD DISP=OLD,DSN=MTRG011.JCL.PDS
//SYSIN DD *
COPY I=DD1,O=DD2
EXCLUDE MEMBER=(IEFBR14)
/*
//
//*WE CAN ALSO INCUDE A SELECTED MEMBER
//*BY USING (SELECT MEMBER =MEM1)
//*WE CAN ALSO OMIT A MEMBER
//*BY USING (EXCUDE MEMBER =MEM1)
To Compare Datasets
//STEP1 EXEC PGM=IEBCOMPR
//SYSUT1 DD DSN=TECH201.JCL.PDS,
// DISP=OLD
//SYSUT2 DD DSN=TECH201.PDS.JCLDUMP,
// DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COMPARE TYPORG=PO
/*
//
TYPORG=PS
To List the VTOC Information

//HLIST EXEC PGM=IEHLIST


//SYSPRINT DD SYSOUT=A
//DD1 DD UNIT=3390,VOL=SER=SMS007,
// DISP=OLD
//SYSIN DD *
LISTVTOC FORMAT,VOL=3390=SMS007,
DSNAME=TECH201.JCL.DEMOS
/*
//
To Scratch/Rename (IEHPROGM)

//IEHPROGM EXEC PGM=IEHPROGM


//SYSPRINT DD SYSOUT=*
//DD1 DD VOL=SER=SMS010,
// UNIT=3390,DISP=OLD
//SYSIN DD *
       RENAME MEMBER=AA,
DSNAME=TECH201.JCL.PDS,
VOL=3390=SMS010,NEWNAME=BB
/*
//
CONCATATION OF DATASETS
//EXEC1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TECH201.CLASS.P1
// DD DISP=SHR,DSN=TECH201.CLASS.P2
//SYSUT2 DD DSN=TECH201.JCL.CONCAT9,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(4,2)),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
//SYSIN DD *
/*
//
REFERBACK:

//E1 EXEC PGM=IEFBR14


//D1 DD DISP=(NEW,CATLG,DELETE),
// DSN=TECH201.PS.NEW,
// SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800)
//D4 DD DCB=*.D1,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(2,1)),DSN=TECH201.PS.NEW1
//
Sort / Merge Utilities :

In data processing environment,records are added, updated or


deleted from a data set as required. Usually these records have one key
identifying field.Each time a record has to be accessed this key
identifying field is referenced. As records continue to be added and/or
deleted as necessary,the end result often is that the contents become
disordered.

IBM provides an excellent sort/merge utility program called


DFSORT.SORT is a program that is embedded in DFSORT.The
SORT program can also be used to merge existing sorted files and
combine them into one sequential file.Since SORT program can also
be used to merge existing sorted files and combine them into one
sequential file.Since it also provides the functionality for merging data
sets, it is called the SORT/MERGE utility.
How the Sort / Merge Utility Works:
Sort function in the SORT utility takes records from
an input file,sorts the records, and places them in an output
file. Merge function of the sort utility takes its input from
the sorted records of multiple files and combines them into
one sequential file.
Records can be arranged in ascending or descending order.
Alphanumeric fields are sorted from left to right, based on
the Collating Sequence of the character set of the data set.
Character fields are sorted based on the alphabet,and
numeric fields are sorted in order of their algebraic
value.The sign is also taken into consideration when sorting
numeric fields.Positive values are greater than negative
value.
Issues Related to SORTS:

• name of the file that is to be sorted.

• name of the file in which the sorted file is to be stored.

• location of the record from which to start sorting.

• whether the records are to be sorted in ascending or


descending order.

• the type of data stored in the data set that is being sorted.
For example, it can be character, packed , etc.
Parameters on SORT command:
The sort command is used to specify features specific to the
sort itself.

Format is :

SORT FIELDS=(ST_LOC,LEN,FORMAT, SORT-SEQUENCE)


St_Loc : is the position from which length number of bytes will be
used as the sort criteria.
Len: Length of field to be sorted.
Format: specifies the type of data that will be sorted.
Sort-sequence : specifies whether the field is to be sorted in ascending
or descending order.
Parameters on SORT command:
Functions:
1. Name of Input file
2. Name of Output file
3. Starting sort location
4. Length of field to be sorted
5. Type of sort to be implemented
6.Type of data stored in data set being sorted. Can be
CH for EBCIDIC character
AC for ASCII character
PD for packed decimal
ZD for Zoned Decimal
BI for Binary
FI for fixed point , FL for Floating Point
SORT Program:

//EXSORT EXEC PGM=SORT


//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=MTRG011.JCL.DEMOS(DET)
//SORTOUT DD DISP=SHR,DSN=MTRG011.JCL.DEMOS(DET4)
//SORTWK1 DD UNIT=SYSDA,SPACE=(TRK,(1,2),RLSE)
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
/*
//
SORT Program:

SUM FIELDS=NONE

INREC FIELDS=(15,7,22,4)

SORT FIELDS=(1,7,CH,D,8,4,CH,A)

INCLUDE COND=(15,7,CH,EQ,C'PRG')
OMIT COND=(15,7,CH,EQ,C'PRG')
SORT FIELDS=(1,3,CH,A,15,3,CH,D)
OMIT COND=(22,4,CH,EQ,C'9000')
Merge Function

Merge Function combines one or more sorted input files


into a single, ordered,sequential file.Merging is faster and
more efficient.Since input files are already in sorted order
before they are merged together.

Format :
merge fields-(st_loc,Len, format,merge_seq)
Merge Program:

//STP1 EXEC PGM=SORT


//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN1 DD DISP=SHR,DSN=MTRG011.JCL.DEMOS(DET)
//SORTIN2 DD DISP=SHR,DSN=MTRG011.JCL.DEMOS(DET1)
//SORTOUT DD DISP=SHR,DSN=MTRG011.JCL.DEMOS(DET2)
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(2,1),RLSE)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(2,1),RLSE)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(2,1),RLSE)
//SYSIN DD *
MERGE FIELDS=(1,3,CH,A)
/*

//
Procedures:
A procedure is a set of standard JOB step definitions
that can be used repeatedly to perform a FUNCTION

Procedures are invoked by EXEC statements

Procedures comprise standard JOB step definitions and:


* PROC statement
* PEND statement
* Symbolic parameters
Two types of procedures:
* Cataloged procedures
* Instream procedures
Instream Procedure:
•Completely contained within a JCL JOB
• String of JCL statements appearing between a proc & pend
statement within a JOB
• Available to only one JOB
• Up to 15 procedures can be defined within a JOB
• Within a JOB, can be invoked any number of times
Cataloged Procedure:
* String of JCL statements defined as a member of one of
the procedure libraries
* Procedure referenced by the name of the member in the
cataloged library.
* Can be used by any number of jobs.
Procedures:
•Procedures begin with proc or EXEC statements.
•Only statements allowed in a procedure are EXEC,
DD & comment.
•Cannot have instream data statements in a
procedure
• A procedure cannot invoke another procedure
• Cannot contain joblib & jobcat Ddnames
Procedures Statements:
• Proc statement
• Marks the beginning of a procedure
• Optional for a cataloged procedure
• Required for an instream procedure; it must appear
as the first control statement in the instream
procedure
• Name is optional for cataloged procedures but
required for instream procedures
Pend Statements:
* Signifies the end of a procedure.
* Name is optional.
Example for Instream Procedure:
//JOB JOB ,,Notify=&SYSUID,TIME=(3)
//PROC1 PROC
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DISP=(NEW,CATLG),
// DSN=MTRG011.CLASS.PROC,
// SPACE=(TRK,(2,1,1)),
// DCB=(DSORG=PO,LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
// PEND
//STP1 EXEC PROC=PROC1
/*
//
Example for Catalog Procedure:

•To be Written in a Separate PDS as a Member


• Member name : catproc

//PROC1 PROC
//EXECUTE EXEC PGM=IEFBR14
//DD1 DD DISP=(NEW,CATLG),DSN=MTRG011.CLASS.PSNE1,
// SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
How to Call the Catalog Procedure:

//MTRG011A JOB,'MANE',NOTIFY=MTRG011
//JL JCLLIB ORDER=MTRG011.JCL.DEMOS
//EXESTEP EXEC PROC=CATPROC
//

* While calling the procedure use the member name not the
procedure name in case of catalog procedure.
Symbolic Parameters:

• A symbolic parameter is a symbol preceded by an


ampersand that stands for a parameter, subparameter or
value
• Use it for values that can change with each
execution of the procedure
• Makes the procedure more flexible & general
purpose
Symbolic Parameters:

• Can be 1-7 characters, alphanumeric or national,


preceded by &

• A keyword parameter that can be coded on the


EXEC statement like time, cond, parm cannot be a
symbolic parameter

• Default values can be specified for a symbolic


parameter in the operand field of the proc statement
Example of Symbolic Parameter with Catalog
Procedure:
Member name : SYM

//PROCS1 PROC MEM=&V1


//STEP1 EXEC PGM=IEFBR14
//DD1 DD DISP=(NEW,CATLG),
// DSN=MTRG011.CLASS.&MEM,
// SPACE=(TRK,(2,1)),
// DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
//
Example of Symbolic Parameter with Catalog
Procedure being called here:

//MTRG011A JOB ,'MANE',NOTIFY=MTRG011

//JL JCLLIB ORDER=MTRG011.JCL.DEMOS

//EXEC1 EXEC PROC=SYM, V1=P2

//
Overriding Parameter:
To override a parameter on the EXEC statement, when
invoking the proc, follow on the proc statement with:
PARAMETER.PROC STEPNAME=VALUE
EG.
DEFINING THE PROC (MEM)
//PROC1 PROC
//STEP1 EXEC PGM=PROG01
//DD1 DD DSN=ABC,DISP=OLD

INVOKING THE PROC


//JOB1 JOB CLASS=5
// JCLLIB ORDER=DSNNAME
//S1 EXEC PROC=MEM
//STEP1.DD1 DD DSN=BBC
//S2 EXEC PROC=MEM
Overriding DD Statements:
• Recode the DD statement with the DDname proc
stepname.Ddname
• No need to recode the entire DD statement. Just
code the changes.
• If overriding more than one DD statement, put the
overriding statements in the same order as they
appear in the procedure
•To add new DD statements, put them after all the
overriding statements
IF/ THEN/ELSE/ENDIF Construct :
The IF/THEN/ELSE/ENDIF construct in JCL allows the
outcome of one JOB step to determine whether following steps are
executed.Either for return code or ABEND code also we can use the
Construct .
EXAMPLE
// IF (STEP4.RC EQ 4 ) THEN
//STEP6 EXEC PGM=ONE
// ELSE
//STEP8 EXEC PGM=GSJ
// ENDIF
The logical expression can contain ‘EQ, NE, GT, LT, GE LE’ and
connect expression with ‘AND, NOT, OR’

// IF NOT (STEP1.RC.EQ 1 AND STEP2.RC EQ 1) THEN

You might also like