0% found this document useful (0 votes)
30 views

JCL - Job Control Language On Mainframes

The document discusses the Job Control Language (JCL) which is used to communicate with IBM mainframes. JCL is used for batch processing to specify the program to run, inputs, and outputs. It consists of control statements that provide detailed information to the operating system. Common JCL statement types include JOB, EXEC, DD, PROC, and more.

Uploaded by

Shubham Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

JCL - Job Control Language On Mainframes

The document discusses the Job Control Language (JCL) which is used to communicate with IBM mainframes. JCL is used for batch processing to specify the program to run, inputs, and outputs. It consists of control statements that provide detailed information to the operating system. Common JCL statement types include JOB, EXEC, DD, PROC, and more.

Uploaded by

Shubham Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

JCL

JOB CONTROL LANGUAGE


1

When we start talking about JCL or thinking about JCL, the first
thing that comes in everyone's mind is, what is a JCL. To alleviate
the problem, JCL is a specific language, which is used by a
programmer or any programmer so to speak, to communicate with
the IBM Mainframe. The meaning of the abbreviation is called JOB
CONTROL LANGUAGE. But its is just not like any other language,
such as English or German or French or any other language.
However, the English alphabets are used to create this typical
language to talk to the Mainframe.

This special language is used only in one of the two principal


processing of the IBM Mainframe world. As some of you know that
when we go to buy an airline ticket or use our credit card, the
necessary processing is done right on the spot. But in the event of
using JCL, it is used only, when there is a batch procesing.

The next question may come to your mind is, what is a Batch
Processing. The Batch Processing is a special kind of processing,
where a group of transactions are presented to the computer in a
batch and a formal request is made to the computer to process it.
The only difference is that, in a batch processing, certain level of
processing is done, with the online up, and in another case, certain
processing are done when the online region is down.

The Job Control Language is primarily used for batch


processing, where the following message is passed to the computer:

• What program will be executed


• What is the input
• What is the output.

Apart from these three pieces of information, the job control language
contains lot more information, which will really amaze you. When
JCL was first introduced in the early sixties, it was greeted by the
programmer community, something akin to a culture shock. The
programmers, who barely tolerated few extra cards, in their card
2

deck, suddenly got overwhelmed with this full blown language, which
is written in English alphabets, is not really English Language. It was
also perceived as a language, far more difficult than the programming
language itself. Computers became so big and powerful that it was
really wasteful to have one single program, use the machine. The
concept arrived about Single Processor and also Multiprocessor.
Instead of one program running at one time. Several programs
started running in the machine and each of the programs was trying
to demand its share of attention from the machine. In today's IT
environment, specially the Mainframe Environment, life without JCL is
simply inconceivable.

But please note that JCL is not something, which is used to


write a program or it is not the language of the program in question.
It assists programs written in other language to be executed in batch
mode. It consists of control statements that introduce a specific
computer job to the Mainframe Operating System and tells, what
program needs to be executed, what is the input, what will be the
output and also other detailed information about the output, as well as
input. In essence, the JCL supplies just about every possible
information on earth, to the operating system, about the input and
output.

There is a general apathy about JCL, in the mind of the


programmers, that JCL is a very difficult thing, but believe me, this is
downright simple, once you gain a mastery of this important
programmer's tool. Just like any other language or any other art, it is
hard at the beginning but later it becomes easy, once you start
understanding this beautiful programmers tool.

As measured by the number of moving parts, the System/370


undoubtedly the most complex creation of human mind, the world has
ever seen. But the capability of this system is unparalleled,
compared to operating systems of other mainframe. What it can do,
is clearly visible by the level of market share that the IBM Mainframe
commands. It is downright easy to understand, which is why, the
programmers never give it up, once they get the taste.
3
WHAT IS A JCL

JUST REMEMBER THAT IT IS NOT A PROCEDURAL


LANGUAGE LIKE OTHERS, BUT IT SURELY HELPS TO RUN THE
PROCEDURAL LANGUAGE. WITHOUT IT, YOU SIMPLY HAVE
NO STANDING AS AN IBM MAINFRAME PROGRAMMER.

The following are the important parameters of JCL


Statements.

 A JCL Statement always starts with // in its first two places

 A JCL Record or CARD is 80 Bytes long, but it is not


necessary that a programmer needs to use all of them

 A JCL Card must have something after the first two bytes,
which contains // and if nothing is there, it will carry some other
meaning

 A JCL Card cannot be more than 80 Bytes

 If information could not be accommodated in one card, it has


to be continued to the next card, but that card, also has to be 80
bytes only.
4
TYPES OF JCL

Currently, there are eight types of JCL, which are in use in the
Mainframe Industry. They are:

• JOB

• EXEC

• DD

• PROC

• PEND

• DELIMITER

• COMMENT

• NULL.

Every type of JCL has a specific role to play in executing a

Batch Execution Job. Also please note that, every type has its

significance in running the job, you cannot say, this is more important

and this is not so important or less important. As you start coding the

JCL, you will find how they are dependent on each other. It is

therefore, a prime responsibility for a Mainframe Programmer to get

himself or herself familiar with all these wonder tools.


5
LET US TALK ABOUT JOB CARD

Let us start with the most important statement, seen in the jobstream,

and it is the JOB Statement or popularly called JOB CARD. This is

the first record or card in a JOB Stream. The JOB Card contains the

following information:

Parameter Name Type of information

// First two bytes

JOBNAME Pos. 3 - 10, identifies the job


in the CPU

JOB Identifier Pos. 12 - 14, written as JOB

Account Information After JOB Identifier, length


Determined by the specific
Installation

Programmer Name Eighteen bytes long, after


Accounting Information

MSGCLASS Contains the pertinent


details, whether the output
should be held in the
spooling area or be routed to
printer

MSGLEVEL How much information the


programmer wants in the
output

JOBCLASS How much resource, the job


Plans to use
6
LET US TALK ABOUT JOB CARD

Parameter Name Position

RESTART If there is a need to


restart the job, after an
abend

PRTY(Priority) Denotes the


seriousness of the job
compared to other jobs

NOTIFY Used to notify the


status of the job, upon
completion

TYPRUN=SCAN Used to detect the


syntax errors in the job

Let us talk in detail about each of the parameters:

JCL IDENTIFIER
The first two bytes of a JCL must contain two slashes, //.

JOBNAME
This is a parameter, which is an identity of the job, you just submitted
to the CPU or computer, sometime ago, it is limited to eight
characters, such as KJAU1234 or ABCD5678. But it must not start
with a numeric value.

JOB
This is a job identifier to the CPU. It tells the CPU or computer that a
batch job has just been submitted now.

ACCOUNTING INFORMATION
This is normally enclosed within Right and Left Parenthesis, and it is
exclusively installation-dependent. It is used for computer usage
7
LET US TALK ABOUT JOB CARD

chargeback, goes back to the days, when IBM used to rent the
machines, instead of outright sales. Currently it is used to denote the
usage in a certain company, among various administrative group.
Example: (36455,,R,TL01,QPC)

PROGRAMMER NAME
This is space of 18 bytes, usually assigned for the Programmer's
name, but that does mean, nothing else can be placed in this area.
This eighteen bytes can be used by the programmer for any reason,
deemed necessary. For example:

'NITIN K. UPADHAYA', 'ANEEK CHAKRABARTY',


'ATLANTA TRAFFICRUN'.

Please note that, the four paramaters mentioned above, are called
POSITIONAL PARAMETERS, because of their use in certain
specific positions. They have to be used in the order of JOBNAME,
JOB ID, ACCOUNTING INFORMATION, PROGRAMMERS NAME.

MSGCLASS
This parameter tells the CPU, what to do with the output of the job,
after completion. For example:
MSGCLASS=M, or MSGCLASS=A.
The industry default is if it is M, the job is held in the spooling area,
and if it is A, the job foes to print. But it can be denoted in the range
of A - Z and 0 - 9.

MSGLEVEL
This parameter conveys to the CPU, how much of output message,
you like to see, after the job completion, both positive or negative. It
has two subparameters, and they are:

MSGLEVEL=(jcl,allocation)
The JCL has the following identifier

0 Print only the JOB Statement


1 Print complete JCL with substitution of all symbolic parameters
8
LET US TALK ABOUT JOB CARD

2 Print only the JCL in the input stream

The Allocation message carries the following values with it:

0 Do not print the allocation message, unless there is an abend


1 Print it always

JOBCLASS
This is normally coded as CLASS=X. For some installations, it is the
amount of hardware, allocated to this job, for others, it is a mix of both
hardware and also the time limit assigned to it. It is entirely
installation dependent parameter.

For example:

Class Meaning

A Allocates 1 Disk Drive and CPU Time < 1 Minute

B Allocates 2 Disk Drives and CPU Time > 1 Minute

C Allocates 2 Disk Drives, 1 Tape Drive and CPU Time > 2


Minutes

D Allocates 1 Disk Drive and CPU Time is > 3 Minutes

E Allocates 2 Disk Drives, 5Tape Drives, 1 Printer, CPU


Time is > 5 Minutes

RESTART
This parameter is used only if there is a need to restart a job at a
certain step, possibly after an abend.
For example:

RESTART=JS050.PS070, means the job has to be restarted in the


seventh step of the fifth proc, denoted by JOBSTEP and PROCSTEP
Parameter.
9
LET US TALK ABOUT JOB CARD

PRTY
This parameter determines the seriousness or the importance of the
job, the value observed between 1 to 15, one being the lowest and 15
being the highest. The determination of this parameter should be left
upto the JES2 or JES3, upon submission of the job. Of course, this
can also be assigned by the operators or the Systems Programmers.
The programmers are not advised to code this parameter to their
wish, which may land them in trouble.

NOTIFY
This parameter informs the submitter or anyone else, whoever's id is
mentioned on the right operand, about the completion status of a job.
Some installations inform the assignee only if they are logged on, but
in other cases, it is flashed on the screen, the moment, they log on.
For example: NOTIFY=GP4ABC

TYTPRUN=SCAN
This is used to check the SYSTAX ERROR for a JCL Jobstream.
Before moving to production, this parameter must be removed. If this
parameter still needs to be retained in the JOB Card, the SCAN
needs to be changed to NOSCAN. The NOSCAN operand will not
do the syntax checking and allow the job to run, but SCAN will
continue checking the SYNTAX error, and prevent the job, from being
run.

All the parameters that you have seen above, with an equal sign (=)
and a variable quantity on the right, are called KEYWORD
PARAMETERS. Please note than a POSITIONAL PARAMETER
does not carry an equal sign. However, this method does not just
apply to job cards only, but throughout the JCL.

THIS IS ALL ABOUT THE JOBCARD, WHICH IS THE VERY FIRST


CARD IN THE JOBSTREAM.
10
LET US TALK ABOUT EXEC CARD

As the name says, EXEC Card, the implication is quiet self-


explanatory, it executes something. What is that something, it is
either a program or a proc.

When the CPU is told to execute a program, it is coded as:


//STEP090 EXEC PGM=ABCD1234.

When the CPU is told to execute a proc, it is coded as:


//STEP090 EXEC ABCD1234.

You must not code it like:


//STEP090 EXEC PROC=ABCD1234.

When EXEC Statement is used with a program, there are four other
parameters which are used along with it, and they are:

PARM, COND, REGION and ADDRSPC. Let us talk in detail about


each one of them.

PARM parameter is used to add additional information to the


program, such as:

//STEP009 EXEC PGM=ABCD1234, PARM='260202', which may


specify that today's processing date is February 26, 2002.

//STEP009 EXEC PGM=ABCD1234, PARM='ACCTRCVL', which


may specify that today's processing date is February 26, 2002.

//STEP009 EXEC PGM=(DLI,KTRT5678,KTRT5678,,,,LUY,)


which may specify that it is an IMS Database Processing, when the
online is down.

//STEP009 EXEC PGM=ABCD1234, PARM='EVEN', which may


specify that This job will execute only on even date of any month.

As said earlier, it just influences the job execution, by adding


additional external information to the program.
11
LET US TALK ABOUT EXEC CARD

COND parameter affects the execution, in an entirely different way.


COND parameter, when associated with any step will follow the
following format.

That particular step will bypass, if the condition is TRUE

That particular step will execute, if the condition is FALSE.

Let us analyze, a little bit more about it. If it is coded as:

//STEP007 EXEC PGM=ABCD1234,


// COND=(0,EQ,STEP003)

If the earlier step STEP003 had a good end of step and had a
RETURN CODE of zero, then this step will be bypassed, since 0 is
equal to 0, as stated in the Condition Code.

If this step needs to be executed, then the coding will be, as follows:

//STEP007 EXEC PGM=ABCD1234,


// COND=(0,NE,STEP003)

where the condition code will not be satisfied. The condition code
can also be manipulated to reflect AND and OR Condition, which
must be coded as followed:

For AND Condition, the conditions need to be stated in one line, as


stated:

//STEP007 EXEC PGM=ABCD1234,


// COND=(0,EQ,STEP002,0,NE,STEP003)

For OR Condition, it has to be stated separately, as shown

//STEP007 EXEC PGM=ABCD1234,


// COND=((0,EQ,STEP002),(0,NE,STEP003))
12
LET US TALK ABOUT EXEC CARD

There are two other parameters, which are used with the EXEC
Statement, in an entirely different scenario. Normally, in a MVS
Environment, a job step is not run, if an earlier jobstep did not end
successfully, if none of the steps has any CONDITION CODE is not
coded.

COND=EVEN is used to run that step, where it is coded, even if any


prior jobstep did not end successfully.

COND=ONLY is used to run that step, where it is coded, only if any


prior jobstep did not end successfully.

REGION Parameter is used only you want to request a specific


region for execution of your job. Most of the production jobs use this
parameter, since they run at a certain time, when the necessary
space is available. But it is highly advisable to leave it, either upto
the operators or to the JES2 or JES3.

It is coded in terms of K, such as REGION=512K or 1024K or 2048K

ADDRSPC is used to add the capability of making the job, pagable or


non-pagable, while executing, and it is coded as:

ADDRSPC=REAL prevents the job, from being paged.

ADDRSPC=VIRT allows the job, to be paged.

The normal installation default is VIRT, but REAL can only be used, if
the user is authorized to use this parameter. The REAL
subparameter is used only for high priority jobs, and the priority is
decided by the Operations Management Group, or someone else with
the appropriate authority. Any application programmer is highly
advised not to use it, unless fully authorized to do so.

But please note carefully that these four parameters are used
only in the EXEC Statements, where a program is executed and
not a proc.
13
LET US TALK ABOUT DD STATEMENT

DD Stands for Data Definition, which means, this statement tells the
computer, everything about all the dataset, used in the particular
proc, both old, as well as new.

However, methods are different to represent old and new datasets,


what we will discuss here. The MVS datasets carry some special
characteristics, which are stated below, before going any further.

There are three types of datasets, used in OS Environments, and


they are: Plain Sequential, Partitioned Dataset and Generation Data
Group.

Plain Sequential datasets are processed in the order, the records


were written in the file and this is a dataset, which exists by itself,
which looks like the following, the straight horizontal lines represent
one record per line:

The Partitioned Datasets are a bundle of sequential datasets, where


the dataset has a higher level identity, which is the name and lower
level identity is where each sequential data, within the cluster is
called a member of the PDS. It looks like this:

The Generation Data G unique set of data, where the


property is a bit differen to other two types, and it is
convenient in this group t member to the group, maintain
the old member of the gr te the oldest member. In this
Unique way of saving dat rmined limit is used, which
controls the number in the group and no manual intervention in
required. When the last entry exceeds the limit, the operating system
automatically deletes the member and readjusts or cycles the whole
group. It is a wonderful way to protect the production data, up to the
desired level. It has two ways of measuring its life and they are:

Relative Generation Number and Absolute Generation Number. We


will discuss this at a later stage.
14
LET US TALK ABOUT DD STATEMENT

Data Set naming convention

1. Any dataset will not be more than 44 characters long and


individual nodes must not be more than eight bytes, connected
by a period.

2. The dataset name must have at least one alphabet, in the


name.

3. The dataset must not start with a numeric value, hyphen or


special character.

4. The dataset must not have a special character within the whole
length of the name.

5. The name should be constructed between A thru Z or 0 thru 9.

A Sequential dataset name should look like this:

GP4ABC.ANNUAL.CUM.PROFIT.DATA

A Partitined Dataset should look like this:

GP4ABC.ANNUAL.CUM.PROFIT.DATA(APR), where the dataset


name is GP4ABC.ANNUAL.CUM.PROFIT.DATA and APR is a
member.

At any time, the dataset will show only one member.


A GDG should look like this:

GP4ABC.ANNUAL.CUM.PROFIT.DATA(0), which means this is the


most recent data, recorded in the group, as shown by its relative
generation number, that is (0).

The limit is determined either by using IDCAMS or IEHPROGM utility


program.
15
LET US TALK ABOUT DD STATEMENT

If the trailer node is:

DATA, it is expected that the dataset has data

LIB, it is a llibrary and what type of library, can be determined


by the name, such a PROCLIB, LOADLIB, PGMLIB,
SORTLIB, PSBLIB, DBDLIB etc.

CNTL Contains Test Procs and JCLs.

How to identify old and new datasets

The old dataset, since already exists, it can be represented by two


parameters, and they are:

DSN, which is dataset name


DISP, which is current status, which can either be SHR or OLD,
coded as:

//OLDDATA DD DSN=GP4ABC.CUMSALES.DATA,DISP=SHR,
where OLDDATA is the DDNAME, as coded in the program, followed
by the DD Statement.

SHR means Share and OLD means OLD, as the name says. All
programmers are advised to use SHR, instead of OLD, since id OLD
is used, the data cannot be used by any other program, until the
whole job is over, but SHR will help other programs to use that data,.
after the specific step is over.
To represent new data, we need the following parameters:

FOR DISK DATASET

DSN = Dataset Name, max limit is 44 Bytes

DISP = (NEW,CATLG,DELETE), this requires three


subparameters, which are:
Status at Creation, it is a new dataset
16
LET US TALK ABOUT DD STATEMENT

Status at Normal Termination, catalog it


Status at abnormal Termination, delete it. It can also be
cataloged if debugging is necessary.

UNIT = What medium will be used for storage, which can be


DISK for Disc Pack, some installations write it as SYSDA
TAPE for T6290 tape or CTAPE for T3480 Cartridge. Of
course, this is again, an installation dependent parameter.

DCB = Data Control Block, which provides other information


about the dataset, such as:
➔ DSCB.GDG specifies the Dataset Control Block for
a Generation Data Group, if one of the GDG Index
is used to save the new dat, just gettign created
➔ LRECL for Record Length, as LRECL=350
➔ RECFM for Record Format, as RECFM=FB, VB or
VBS, where FB stands for Fixed Block, VB for
Variable Block and VBS for Variable Block Span
➔ BLKSIZE tells how many records are blocked
together

➔ DSORG tells whether it is a sequential data or a


PDS
➔ OPTCD=Q converts ASCII to EBCDIC and vice-
versa
➔ BUFNO=8 tells how many data buffer is necessary
for this job.
But the last three subparameters for DCB are rarely used these days,
since the dataset name itself tells whether it is a seq data or a PDS.
Most of the data processed in the machine are already of EBCDIC
format and MVS provides for the BUFFER, based upon data volume.

SPACE= How much space, this dataset needs, which is coded in


the form of the unit of storage and then followd by the
primary and secondary allocation, such as:
17
LET US TALK ABOUT DD STATEMENT

SPACE=(TRK,(200,20),RLSE), where TRK means the


space is requested in terms of Tracks, the primary
allocation is 200 Bytes and the secondary allocation or
EXTENT is 20. It can also be requested in terms of
Cylinders(CYL) or Blocks(BLKS).

This will provide a total space of 200 + 15X20 = 500


Tracks. Every time, an extent is requested, MVS will
release only 15 tracks, until all requested extents are
exhausted.

VOL=SER= A Volume Serial Number is added in the JCL or PROC,


if you may call it, if there is a need to place data in a
specific pack. If not stated, the MVS will find a pack,
where the requested space is available.

FOR DISK DATASET

DSN = Dataset Name, max limit is 44 Bytes

DISP = (NEW,CATLG,DELETE), this requires three


subparameters, which are:
Status at Creation, it is a new dataset
Status at Normal Termination, catalog it
Status at abnormal Termination, delete it. It can also be
cataloged if debugging is necessary.

UNIT = What medium will be used for storage, which can be


DISK for Disc Pack, some installations write it as SYSDA
TAPE for T6290 tape or CTAPE for T3480 Cartridge. Of
course, this is again, an installation dependent parameter.

DCB = Data Control Block, which provides other information


about the dataset, such as:
➔ LRECL for Record Length, as LRECL=350
➔ RECFM for Record Format, as RECFM=FB, VB or
18
LET US TALK ABOUT DD STATEMENT

VBS, where FB stands for Fixed Block, VB for


Variable Block and VBS for Variable Block Span
➔ BLKSIZE tells how many records are blocked
together

➔ DSORG tells whether it is a sequential data or a


PDS
➔ OPTCD=Q converts ASCII to EBCDIC and vice-
versa
➔ BUFNO=8 tells how many data buffer is necessary
for this job.
But the last three subparameters for DCB are rarely used these days,
since the dataset name itself tells whether it is a seq data or a PDS.
Most of the data processed in the machine are already of EBCDIC
format and MVS provides for the BUFFER, based upon data volume.

SPACE= How much space, this dataset needs, which is coded in


the form of the unit of storage and then followd by the
primary and secondary allocation, such as:

SPACE=(TRK,(200,20),RLSE), where TRK means the


space is requested in terms of Tracks, the primary
allocation is 200 Bytes and the secondary allocation or
EXTENT is 20. It can also be requested in terms of
Cylinders(CYL) or Blocks(BLKS).

This will provide a total space of 200 + 15X20 = 500


Tracks. Every time, an extent is requested, MVS will
release only 15 tracks, until all requested extents are
exhausted.

VOL=SER= A Volume Serial Number is added in the JCL or PROC,


if you may call it, if there is a need to place data in a
specific pack. If not stated, the MVS will find a pack,
where the requested space is available.
19
` LET US TALK ABOUT PROC STATEMENT

Proc Statements are nothing but job steps with an added parameters,
called SYMBOLIC PARAMETERS.

You see, coding numerous JCL Statements, is usually error-prone.


As a result, JCL Statements, which have potential to be used by more
than one users, are often placed in a cataloged procedure library.
You may invoke the JCL with a single EXEC Statements, and it will
execute all the programs in that particular procedure. As said earlier,
cataloged procedures are placed in a PDS, normally called
PROCLIBs, which is the trailer qualifier. The name of the High Level
qualifier is determined by the appropriate installation, such as:

SYS1.PROCLIB SYS2.PROCLIB

GA.CENTRAL.PROCLIB REGION.SOUTH.PROCLIB.

Instream procedures are identical to cataloged procedures except


that they are placed right along with the job, in the input stream itself,
immediately after the job statements, rather as members in a proclib.
Instream procs are used to verify the accuracy of the proc before
placed in the production libraries. The biggest advantage of a proc is
that, the same jobstream can be used in various departments of a
company, just by changing the identifying and other related variables,
and these changing information can be assigned to the symbolic
parameters. The symbolic parameters can either be used either in
the execution JCL or in the body of the proc, whichever is the
installation standard.

Please also note that the cataloged procedures must not have the
following:

- A JOB Card
- Any Null Statements
- Any instream data
- Any JOBLIB Statement
- Any JES2 or JES3 Control Statements
- No PROC within a PROC
20
LET US TALK ABOUT PROC STATEMENT

Cataloged Procedures are normally kept in a system library named,


as stated earlier, at the discretion of the systems staff.

It may also happen that several system proclibs are concatenated to


each other. When a proc is about to be executed, the MVS looks at
the first library, if the proc is not found, it will automatically go the
second library of the concatenated structure, until it is found in any of
the libraries, as stated below,

//EASTPROC JOB (AACT INFO) 'EASTSIDE PRCESSING'……


//JOBLIB DD DSN=SYS1.PROCLIB,DISP=SHR
// DD DSN=SYS2.PROCLIB,DISP=SHR
// DD DSN=SYS3.PROCLIB,DISP=SHR
// DD DSN=SYS4.PROCLIB,DISP=SHR
// DD DSN=SYS5.PROCLIB,DISP=SHR

Let us see, how a proc looks and how we substitute the


symbolic in the body of the proc. The following is a real
production proc in a company:

SAMPLE OF A PRODUCTION BATCH PROC WITH DBB FUNCTIONAL MODE

*********** THIS IS THE BEGINNING OF THE PROC MABTIM03 ************


//MABTIM03 PROC HLQ=PP,FILE=PRD,SCN=SCN   
//**********************************************************************
//* UPDATE CENTRAL INVENTORY FILE
//**********************************************************************
//* PROGRAM MABTIM3A WILL PERFORM THE ACTUAL UPDATE OF THE
//* INVENTORY
//**********************************************************************
//MABTIM3A EXEC PGM=DFSRRC00,REGION=4096K,
// PARM=(DBB,MABTIM3A,MABTIM3A,7,0000,,0,,N,O,T,,,,,,N),
// COND=(20,LE)
//FORM49 OTPUT LINECT=49
//STEPLIB DD DSN=TSYS2ATT.$APPNM..LOAD,DISP=SHR
//IMSACB DD DSN=$HLQ.GB.IMSVS.ACBLIB,DISP=SHR
//*
//******************* INPUT AND OUTPUT FILES *************************
//TI01 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV01,DISP=SHR
//TI02 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV02,DISP=SHR
//TI03 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV03,DISP=SHR
//TI04 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV04,DISP=SHR
//TI05 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV05,DISP=SHR
//TI06 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV06,DISP=SHR
//TI07 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV07,DISP=SHR
//*
//***************** INPUT PARM CARD FILE ***********************
//*
//PARMFILE DD DUMMY
//*
//***************** MESSAGE DISPLAY FILE *************************
//SYSOUT DD SYSOUT=*
//*
//***************** DLI AND VSAM BUFFERS ************************
//DFSVSAMP DD DSN=&HLQ.GB.&FILE.DBA.BUFFERS(MABTIM3A),DISP=SHR
//***************** DATA BASE FILES *******************************
//DD1SX00H DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX00H,DISP=SHR
//DD1SX00I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX00I,DISP=SHR
//DD1SX01I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX01I,DISP=SHR
//DD1IT00H DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT00H,DISP=SHR
//DD1IT00I DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT00I,DISP=SHR
//DD1IT01I DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT01I,DISP=SHR
//DD1IT03I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX03I,DISP=SHR
//****************** ABEND ARRANGEMENTS ***********************
//PRINTER DD SYSOUT=(,),OUTPUT=*.FORM49
//PRINTER2 DD SYSOUT=(,),OUTPUT=*FORM49
//SYSABEND DD SYSOUT=*
//SYSABOUT DD SYSOUT=*

As you can see, there are only three symbolics are used in this
proc, and they are:

HLQ=PP,FILE=PRD,SCN=SCN

When these symbolics are represented in the proc, a single


ampersand(&) used before the symbolic parameter. Let us substiture
one of the lines with the variables supplied:

This is one of the lines in the proc:

//TI01 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV01,DISP=SHR

This will be replaced as follows:

//TI01 DD DSN=PP.GBV.PRD.SCN.TREND.INV01,DISP=SHR.
21
LET US TALK ABOUT PROC STATEMENT

As you can see that, this proc can be used in several places in the
company, just by changing the variables, represented by the
symbolic parameters. This is the major convenience of using a
cataloged proc, which prevents you from writing the proc all over
again, with different variables, which can easily be replaced by the
symbolic parameter.

LET US TALK ABOUT PEND STATEMENT

PEND Statement is a parameter, which is used to mark the end of an


Instream PROC.

It is coded at the end of the last statement of the PROC, as stated


below:

// PEND, where you have to place at least one blank spaces, two is
better, followed by the word PEND.

LET US TALK ABOUT DELIMITER

Delimiter Statements are used, only in association with instream data.


There are two types of usage of data in the JCL, the first type is a
cataloged data, sitting somewhere in the installation on a specific
diskpack. But in other cases, it can be coded with the jobstream
itself. Under that scenario, delimiter tells the CPU or computer, if you
may call it, that this is the end of the input data. But in coding the
instream data, the DDNAME as usual, has to be used, followed by a
DD *

The common procedure of coding a delimiter is /*, as stated below:

INPUTTWO DD *

ASSAM IS ONE OF THE STATE OF INDIA


22
LET US TALK ABOUT PROC STATEMENT

Proc Statements are nothing but job steps with an added parameters,
called SYMBOLIC PARAMETERS.

You see, coding numerous JCL Statements, is usually error-prone.


As a result, JCL Statements, which have potential to be used by more
than one users, are often placed in a cataloged procedure library.
You may invoke the JCL with a single EXEC Statements, and it will
execute all the programs in that particular procedure. As said earlier,
cataloged procedures are placed in a PDS, normally called
PROCLIBs, which is the trailer qualifier. The name of the High Level
qualifier is determined by the appropriate installation, such as:

SYS1.PROCLIB SYS2.PROCLIB

GA.CENTRAL.PROCLIB REGION.SOUTH.PROCLIB.

Instream procedures are identical to cataloged procedures except


that they are placed right along with the job, in the input stream itself,
immediately after the job statements, rather as members in a proclib.
Instream procs are used to verify the accuracy of the proc before
placed in the production libraries. The biggest advantage of a proc is
that, the same jobstream can be used in various departments of a
company, just by changing the identifying and other related variables,
and these changing information can be assigned to the symbolic
parameters. The symbolic parameters can either be used either in
the execution JCL or in the body of the proc, whichever is the
installation standard.

Please also note that the cataloged procedures must not have the
following:

- A JOB Card
- Any Null Statements
- Any instream data
- Any JOBLIB Statement
- Any JES2 or JES3 Control Statements
- No PROC within a PROC
23
LET US TALK ABOUT PROC STATEMENT

Cataloged Procedures are normally kept in a system library named,


as stated earlier, at the discretion of the systems staff.

It may also happen that several system proclibs are concatenated to


each other. When a proc is about to be executed, the MVS looks at
the first library, if the proc is not found, it will automatically go the
second library of the concatenated structure, until it is found in any of
the libraries, as stated below,

//EASTPROC JOB (AACT INFO) 'EASTSIDE PRCESSING'……


//JOBLIB DD DSN=SYS1.PROCLIB,DISP=SHR
// DD DSN=SYS2.PROCLIB,DISP=SHR
// DD DSN=SYS3.PROCLIB,DISP=SHR
// DD DSN=SYS4.PROCLIB,DISP=SHR
// DD DSN=SYS5.PROCLIB,DISP=SHR

Let us see, how a proc looks and how we substitute the


symbolic in the body of the proc. The following is a real
production proc in a company:

SAMPLE OF A PRODUCTION BATCH PROC WITH DBB FUNCTIONAL MODE

*********** THIS IS THE BEGINNING OF THE PROC MABTIM03 ************


//MABTIM03 PROC HLQ=PP,FILE=PRD,SCN=SCN   
//**********************************************************************
//* UPDATE CENTRAL INVENTORY FILE
//**********************************************************************
//* PROGRAM MABTIM3A WILL PERFORM THE ACTUAL UPDATE OF THE
//* INVENTORY
//**********************************************************************
//MABTIM3A EXEC PGM=DFSRRC00,REGION=4096K,
// PARM=(DBB,MABTIM3A,MABTIM3A,7,0000,,0,,N,O,T,,,,,,N),
// COND=(20,LE)
//FORM49 OTPUT LINECT=49
//STEPLIB DD DSN=TSYS2ATT.$APPNM..LOAD,DISP=SHR
//IMSACB DD DSN=$HLQ.GB.IMSVS.ACBLIB,DISP=SHR
//*
//******************* INPUT AND OUTPUT FILES *************************
//TI01 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV01,DISP=SHR
//TI02 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV02,DISP=SHR
//TI03 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV03,DISP=SHR
24
LET US TALK ABOUT PROC STATEMENT

//TI04 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV04,DISP=SHR
//TI05 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV05,DISP=SHR
//TI06 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV06,DISP=SHR
//TI07 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV07,DISP=SHR
//*
//***************** INPUT PARM CARD FILE ***********************
//*
//PARMFILE DD DUMMY
//*
//***************** MESSAGE DISPLAY FILE *************************
//SYSOUT DD SYSOUT=*
//*
//***************** DLI AND VSAM BUFFERS ************************
//DFSVSAMP DD DSN=&HLQ.GB.&FILE.DBA.BUFFERS(MABTIM3A),DISP=SHR
//***************** DATA BASE FILES *******************************
//DD1SX00H DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX00H,DISP=SHR
//DD1SX00I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX00I,DISP=SHR
//DD1SX01I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX01I,DISP=SHR
//DD1IT00H DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT00H,DISP=SHR
//DD1IT00I DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT00I,DISP=SHR
//DD1IT01I DD DSN=&HLQ.GBD.&FILE.SCN.DBDIT01I,DISP=SHR
//DD1IT03I DD DSN=&HLQ.GBD.&FILE.SCN.DBDSX03I,DISP=SHR
//****************** ABEND ARRANGEMENTS ***********************
//PRINTER DD SYSOUT=(,),OUTPUT=*.FORM49
//PRINTER2 DD SYSOUT=(,),OUTPUT=*FORM49
//SYSABEND DD SYSOUT=*
//SYSABOUT DD SYSOUT=*

As you can see, there are only three symbolics are used in this
proc, and they are:

HLQ=PP,FILE=PRD,SCN=SCN

When these symbolics are represented in the proc, a single


ampersand(&) used before the symbolic parameter. Let us substiture
one of the lines with the variables supplied:

This is one of the lines in the proc:

//TI01 DD DSN=&HLQ.GBV.&FILE.SCN.TREND.INV01,DISP=SHR

This will be replaced as follows:


25
LET US TALK ABOUT PROC STATEMENT

//TI01 DD DSN=PP.GBV.PRD.SCN.TREND.INV01,DISP=SHR.

As you can see that, this proc can be used in several places in the
company, just by changing the symbolic parameter. This is the major
convenience of using a cataloged proc, which prevents you from
writing the proc all over again, with different variables, which can
easily be replaced by the symbolic parameter.

LET US TALK ABOUT PEND STATEMENT

PEND Statement is a parameter, which is used to mark the end of an


Instream PROC.

It is coded at the end of the last statement of the PROC, as stated


below:

// PEND, where you have to place at least one blank spaces, two is
better, followed by the word PEND.

LET US TALK ABOUT DELIMITER

Delimiter Statements are used, only in association with instream data.


There are two types of usage of data in the JCL, the first type is a
cataloged data, sitting somewhere in the installation on a specific
diskpack. But in other cases, it can be coded with the jobstream
itself. Under that scenario, delimiter tells the CPU or computer, if you
may call it, that this is the end of the input data. But in coding the
instream data, the DDNAME as usual, has to be used, followed by a
DD *

The common procedure of coding a delimiter is /*, as stated below:

INPUTTWO DD *

ASSAM IS ONE OF THE STATE OF INDIA


BELGIUM PRODUCES THE BEST GLASS IN THE WORLD
CHARLIE CHAPLIN, THE BEST COMEDIAN OF THE WORLD
26
LET US TALK ABOUT PROC STATEMENT

DAVIS CUP IS A COVETED PRIZE FOR ALL TENNIS PLAYERS


EUROPE WAS WISE TO ADOPT A COMMON CURRENCY
FRAANCE IS THE PROUD OWNER OF EIFFEL TOWER
/*

But if /* is the first two bytes of any record of the instream data, a
different delimiter needs to be used, a stated below:

//INPUTTWO DD *,DLM='ZZ'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddd
/*eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ZZ

You can very well see the difference by looking at the two sets of
instream data representation. In the top set, there is no data, where
the first and second place is occupied by /*, so the delimiter used was
/*, but the setup had to be changed for the second set of data,
because there was one record following that condition.

LET US TALK ABOUT COMMENT

Comment Statements are used in the JCL, only for one purpose, and
that is documentation. For any Mainframe Environment,
documentation is extremely important, and it is highly advised to use
comment statement in the body of the JCL. In the Comment
Statement, an asterisk needs to be added after the first two slashes.

For example:

//*****************************************************************************
//* THIS STEP PERFORMS THE PLAIN JCL COPY OF THE INPUT
//* FILE TO THE OUTPUT FILE USING THE IBM UTILITY.
//*****************************************************************************
27
LET US TALK ABOUT COMMENT STATEMENT

//STEP001 EXEC PGM=IEBGENER


//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=GP4ABC.GEN.INPUT. DATA, DISP=SHR
//SYSUT2 DD DSN=………………………………………………
//*****************************************************************************
//* THIS STEP EXECUTES THE PROGRAM TYR996L7, AND
//* CONSOLIDATES ALL THE ACCOUNTS RECEIVABLE
//*****************************************************************************
//STEP2 EXEC PGM=TYR996L7
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//TABLEIN DD DSN=GACTN.TPFC6678.ANN.DATA,DISP=SHR
//CRRATIO DD DSN=GARTN.TPFC2957.MTH.DATA,DISP=SHR
//NEWRAT DD DSN=GARKN.TRFC5665.GENERAL.DATA,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(100,20),RLSE),
// DCB=(RECFM=FB,LRECL=1680,BLKSIZE=16800),
// VOL=SER=TPRT2991
.

LET US TALK ABOUT NULL

NULL is a type of statement, which, as the name says, has nothing


and it is coded as just two slashes. This effectively denotes the end of
the job stream. If you do not code it, the job will still end, if the CPU
cannot find anything, after the last card, it processed. The right way
to code a JCL is to end it with a NULL Statement.

But please note that, a null statements must not be added in the
middle of two jobsteps, which will effectively prevent the second job
step from executing, since the MVS or JES2 will think that this is the
end of the job. If you want to add readability in the proc, please add a
comment statement after the last line of the previous step, followed
by the comment, attributed to the next step.
For example:
29
LET US TALK ABOUT NULL STATEMENT

If an execution jcl is coded as follows:

//*****************************************************************************
//* THIS STEP PERFORMS THE PLAIN JCL COPY OF THE INPUT
//* FILE TO THE OUTPUT FILE USING THE IBM UTILITY.
//*****************************************************************************
//STEP001 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=GP4ABC.GEN.INPUT. DATA, DISP=SHR
//SYSUT2 DD DSN=………………………………………………
//
//*****************************************************************************
//* THIS STEP EXECUTES THE PROGRAM TYR996L7, AND
//* CONSOLIDATES ALL THE ACCOUNTS RECEIVABLE
//*****************************************************************************
//STEP2 EXEC PGM=TYR996L7
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*

Extreme care must be taken to make sure that if you decide to add a
NULL statement, it has to be, ONLY AT THE END OF A JOB.
30
LET US TALK ABOUT JCL RECAP

JUST TO GIVE A BRIEF RECAP FOR ALL EIGHT JCL


STATEMENTS:

JOB Statement tells the computer or CPU that, a task is submitted to


you, please perform it.

EXEC Statement tells the computer or CPU, what program or what


PROC needs to be executed.

DD Statement tells the computer or CPU, all the details for new, as
well as existing datasets.

COMMENT Statement tells the computer or CPU that, the following


details are just information and does not require to be processed.

PROC Statement tells the computer or CPU that, this is the


cataloged procedure, needs to be executed, preceded by the EXEC
Statement.

PEND Statement tells the computer or CPU that, this is the end of
the procedure, needs to be executed, preceded by the EXEC
Statement. This applies only for In-stream Procs only and not
cataloged procs.

NULL Statement tells the computer or CPU that, this is the end of
the jobstream.

DELIMETER Statement tells the computer or CPU that, this is the


end of the In-Stream Data. If it is not given, the CPU will still
understand that the end of data has been reached. But if you want to
follow picture-perfect procedure, about how to code an Instream
Data, this will be a good idea to code a DELIMETER Statement.

SUPPORTING DD Statement tells the computer or CPU that, this is


a DD Statement. However, it does not support or tell the status of a
dataset. They are preceded by SYSPRINT, SYSOUT, SYSABOUT
and SYSUDUMP, and other company specific information.
31
LET US TALK ABOUT JCL RECAP

HAVE A GOOD UNDERSTANDING FOR ALL THESE EIGHT

STATEMENTS, AND YOUR SMOOTH JOURNEY THRU

THE WORLD OF MAINFRAME TECHNOLOGY IS SURELY,

ABSOLUTELY AND POSITIVELY GUARANTEED.

GOOD LUCK.

You might also like