9.1.09

JCL Utilitie's

Dataset utilities

1.IDCAMS
IDCAMS ("Access Method Services") generates and modifies VSAM and Non-VSAM datasets. The "Access Method" reference derives from the initial "VSAM replaces all other access methods" mindset of OS/VS. It probably has the most functionality of all the utility programs, performing many functions, for both VSAM and non-VSAM files. It was intended to replace most of the other dataset utility programs. Example:
//XXXXXXXW JOB XXXXXXX,AAAA,CLASS=G,MSGCLASS=1,NOTIFY=&SYSUID
//STEP001 EXEC PGM=IDCAMS
//SYSIN DD *
REPRO INFILE(FILE01) OUTFILE(FILE02)
/*
//FILE01 DD DSN=PROD.FILE1.INPUT,DISP=SHR
//FILE02 DD DSN=PROD.FILE2.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DASD,
// SPACE=(TRK,(100,10),RLSE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=9
//*
In the example above, SYSIN control cards are coming from an in-stream file, but you can instead point to any sequential file or a PDS member containing control cards, if you wish. Example of using SYSIN files would be something like this:
//SYSIN DD DSN=PROD.MYFILE.REPRO,DISP=SHR
or this:
//SYSIN DD DSN=PROD.MYLIB.CNTLLIB(REPRO),
// DISP=SHR


2.IEBCOMPR
IEBCOMPR compares records in sequential or partitioned data sets.
The IEBCOMPR utility is used to compare two sequential or partitioned datasets. This data set comparison is performed at the logical record level. Therefore, IEBCOMPR is commonly used to verify that a backup copying of a data set is current.
During processing, IEBCOMPR compares each record from each data set, one by one. If the records are unequal, IEBCOMPR lists the following information in the SYSOUT:
The record and block numbers in question.
The names of the DD statements in which the inconsistency occurred.
The unequal records.
When comparing sequential data sets, IEBCOMPR considers the data sets equal if the following conditions are met:
·
The data sets contain the same number of records.
The corresponding records and keys are identical.
For partitioned data sets, IEBCOMPR considers the data sets equal if the following conditions are met:
·
The directory entries for the two partitioned data sets match - that is, the names are the same, and the number of entries are equal.
The corresponding members contain the same number of records.
The corresponding records and keys are identical.
If ten unequal comparisons are encountered during processing, IECOMPR terminates with the appropriate message.
//XXXXXXXW JOB XXXXXXX,AAAA.A.A,CLASS=G,MSGCLASS=1,NOTIFY=XXXXX
//STEP01 EXEC PGM=IEBCOMPR,ACCT=PJ00000000
// INCLUDE MEMBER=@BATCHS
//SYSIN DD DUMMY
//SYSUT1 DD DSN=XXXXXXX.OLDFILE,UNIT=DASD,DISP=SHR
//SYSUT2 DD DSN=XXXXXXX.NEWFILE,UNIT=DASD,DISP=SHR
//SYSUT# DD


Note: IEBCOMPR is not a very flexible or user-friendly compare program. It can't restrict the comparison to only certain columns, it can't ignore differences in white space, it doesn't tell you where in the record the difference occurs, and it halts after 10 differences. On the other hand, it is fast, and it is present on all IBM mainframes. So it is very useful in comparing load modules, or checking that a copy worked properly. For comparisons of programs or reports, the ISPF SuperC (ISRSUPC) compare program is often used instead.


3.IEBCOPY
IEBCOPY copies, compresses and merges partitioned data sets. It can also select or exclude specified members during the copy operation, and rename or replace members.
Some of the tasks that IEBCOPY can perform include the following:
Creating a backup of a partitioned data set (PDS)
Copying a PDS in place to reclaim the unused space from deleted members; Also called compressing a PDS.
Copying selected members to another PDS.
Renaming selected members of a PDS.
Merging multiple partitioned data sets into a single PDS.
Altering, copying and reblocking load modules.
The IEBCOPY utility differs from the other IEB-type utilities in that the DDNAMEs of the input and output DD statements are defined in the user commands as opposed to using the standard SYSUT1 and SYSUT2 DDNAMEs. For the IEBCOPY utility, the required job control statements are as follows:
//stepname EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=class
//MYDD1 DD DSN=xxxx.ppp.psps,DISP=shr
//MYDD2 DD DSN=xxxx.ppp.pssp,DISP=shr
//SYSIN DD *
COPY INDD=MYDD1,
OUTDD=MYDD2
SELECT MEMBER=(mem1,mem2,mem3)/ EXCLUDE member=(sf,df,sa)
/*
//
The MYDD1 and MYDD2 DD statements are names chosen by the user for the partitioned input and output data sets, respectively. You can use any valid DDNAME for these two DD statements. These DDNAMEs are specified in the utility control statements to tell IEBCOPY the name of the input and output data sets.


4.IEBDG
IEBDG ('Data Generator') creates test datasets consisting of patterned data.


5.IEBEDIT
IEBEDIT selectively copies portions of JCL.
An example of an IEBEDIT program:
//IEBEDITJ JOB ACCT,'',CLASS=P,MSGCLASS=T,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP0001 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=xxxxx.yyyyy.zzzzz,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP10,STEP5,STEP15)
/*
//


In data set xxxxx.yyyyy.zzzzz you have to write a JCL program which contains 15 steps. After that you have to execute the above program.
The syntax of the EDIT statement is:
[label] EDIT [START=jobname]
[,TYPE={POSITIONINCLUDEEXCLUDE}]
[,STEPNAME=(namelist)]
[,NOPRINT]
START=jobname specifies the name of the input job to which the EDIT statement applies. Each EDIT statement must apply to a separate job. If START is specified without TYPE and STEPNAME, the JOB statement and all job steps for the specified job are included in the output.
Default: If START is omitted and only one EDIT statement is provided, the first job encountered in the input data set is processed. If START is omitted from an EDIT statement other than the first statement, processing continues with the next JOB statement found in the input data set.
TYPE={POSITIONINCLUDEEXCLUDE} specifies the contents of the output data set. These values can be coded:


POSITION specifies that the output is to consist of a JOB statement, the job step specified in the STEPNAME parameter, and all steps that follow that job step. All job steps preceding the specified step are omitted from the operation. POSITION is the default.


INCLUDE specifies that the output data set is to contain a JOB statement and all job steps specified in the STEPNAME parameter.


EXCLUDE specifies that the output data set is to contain a JOB statement and all job steps belonging to the job except those steps specified in the STEPNAME parameter.


STEPNAME=(namelist) specifies the names of the job steps that you want to process.
namelist can be a single job step name, a list of step names separated by commas, or a sequential range of steps separated by a hyphen (for example, STEPA-STEPE). Any combination of these may be used in one namelist. If more than one step name is specified, the entire namelist must be enclosed in parentheses.


When coded with TYPE=POSITION, STEPNAME specifies the first job step to be placed in the output data set. Job steps preceding this step are not copied to the output data set.


When coded with TYPE=INCLUDE or TYPE=EXCLUDE, STEPNAME specifies the names of job steps that are to be included in or excluded from the operation. For example, STEPNAME=(STEPA,STEPF-STEPL,STEPZ) indicates that job steps STEPA, STEPF through STEPL, and STEPZ are to be included in or excluded from the operation.


If STEPNAME is omitted, the entire input job whose name is specified on the EDIT statement is copied. If no job name is specified, the first job encountered is processed.
NOPRINT specifies that the message data set is not to include a listing of the output data set.
Default: The resultant output is listed in the message data set.


6.IEBGENER
IEBGENER copies records from a sequential dataset, or creates a partitioned dataset.
Some of the tasks that IEBGENER can perform include the following:
Creating a backup of a sequential data set or a member of a PDS.
Changing the physical block size or logical record length of a sequential data set.
Creating an edited data set.
Printing a sequential data set or a member of a PDS.
Creating partitioned output data set from sequential input data set.
An example of an IEBGENER program to copy one dataset to another:
//IEBGENER JOB ACCT,'DATA COPY',MSGCLASS=J,CLASS=A
//STEP010 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=xxxxx.yyyyy.zzzzz,DISP=SHR
//SYSUT2 DD DSN=aaaaa.bbbbb.ccccc,DISP=(,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(5,5),RLSE),
// DCB=(RECFM=FB,LRECL=1440)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
For straight copy tasks, the sort program can often do these faster than IEBGENER. Thus many mainframe shops make use of an option that automatically routes such tasks to the sort ICEGENER program instead of IEBGENER.


On some systems it is possible to send email from a batch job by directing the output to the "SMTP" external writer. On such systems, the technique is as follows:
//IEBGENER JOB ACCT,'DATA COPY',MSGCLASS=J,CLASS=A
//NORMRC EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *,LRECL=80
HELO
MAIL FROM:
RCPT TO:
DATA
From:
To:
Subject: Test Mail

TEST MAIL FROM MAINFRAME
.
QUIT
/*
//SYSUT2 DD SYSOUT=(B,SMTP),LRECL=80
//SYSIN DD DUMMY


7.IEBIMAGE
IEBIMAGE manipulates character set definitions (aka "load modules" or "images") for the IBM 3800 printing subsystem. Common uses are for images of forms to be printed on the output along with the text, for company logos to be printed on the page, or just to print 'graybar' pages (alternating gray & white horizontal backgrounds, to match the previous greenbar paper). With this utility, many different forms or logos could be stored as images, and printed when needed, all using the same standard blank paper, thus eliminating the need to stock many preprinted forms, and the need for operators to stop the printer and change paper.


8.IEBISAM
IEBISAM unloads, loads, copies and prints ISAM datasets. This is largely obsolete — ISAM has been replaced by VSAM on most modern operating systems, so the IDCAMS utility is used instead of this.


9.IEBPTPCH
IEBPTPCH ("PrinT and PunCH") prints or punches records from a sequential or partitioned dataset.
Some of the tasks that IEBPTPCH can perform include the following:
Printing or punching an entire data set, sequential or partitioned (PDS).
Printing or punching selected PDS members.
Printing or punching selected records from a sequential or partitioned data set.
Printing or punching a PDS directory.
Printing or punching an edited version of a sequential data set or PDS.
//IEBPTPCH JOB
// EXEC PGM=IEBPTPCH
//SYSIN DD *
PRINT MAXFLDS=2
TITLE ITEM=('Name',22),
ITEM=('GPA',50)
TITLE ITEM=(' ',1)
RECORD FIELD=(25,1,,22),
FIELD=(4,51,,50)
/*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
Person 1 307 C Meshel Hall 3.89
Second person 123 Williamson Hall 2.48
3rd person 321 Maag Library 1.52
/*
//SYSUT2 DD SYSOUT=*
//


10IEBUPDTE
IEBUPDTE ("UPDaTE") incorporates changes to sequential or partitioned datasets. The UNIX patch utility is a similar program, but uses different input format markers (e..g, "./ INSERT ..." in MVS becomes "@@..." in Unix Patch).
Some programmers pronounce it "I.E.B. up-ditty".
The IEBUPDTE utility is used to maintain source libraries. Some of the functions that IEBUPDTE can perform include the following:
Creating and updating libraries
Modifying sequential data sets or PDS members
Changing the organization of a data set from sequential to partitioned or from partitioned to sequential.


IEBUPDTE is commonly used to distribute source libraries from tape to DASD.
IEBUPDTE uses the same job control statements required by most IEB-type utilities. The only exceptions are as follow:
IEBUPDTE accepts a PARM parameter coded on the EXEC statement, NEW or MOD. NEW indicates that the utility control statements and the input data are contained in the SYSIN DD statement, so no SYSIN1 DD statement is needed. MOD indicates that the SYSIN DD statement contains only utility control statements, without input data. Therefore, the SYSUT1 DD statement is required to define the input data set.
IEBUPDTE reads the input data set from either the SYSUT1 DD statement or from the SYSIN



DD statement.
The job control used by IEUPDTE are as follows:
//stepname EXEC PGM=IEUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=class
//SYSUT1 DD ...
//SYSUT2 DD ...
//SYSIN DD ...
Scheduler utilities


11.IEFBR14
IEFBR14 is a dummy program, normally inserted to JCL when the only desired action is allocation or deletion of datasets.
An example of an IEFBR14 step:
//IEFBR14 JOB ACCT,'DELETE DATASET'
//STEP01 EXEC PGM=IEFBR14
//DELDD DD DSN=xxxxx.yyyyy.zzzzz,
// DISP=(MOD,DELETE,DELETE),UNIT=DASD
The calling sequence for OS/360 contained the return address in Register 14. A branch to Register 14 would thus immediately exit the program. However, before and after executing this program, the operating system would allocate & deallocate datasets as specified in the DD statements, so it is commonly used as a quick way to set up or remove datasets.
It consisted initially as a single instruction a "Branch to Register" 14. The mnemonic used in the IBM Assembler was BR and hence the name: IEF BR 14.
This single instruction program had an error in it — it didn't set the return code. Hence a second instruction had to be added to clear the return code so that it would exit with the correct status.
There was an additional error reported and fixed by IBM on this now two instruction program. This error was due to the IEFBR14 program not being link-edited as reentrant.


System utilities
These utilities are normally used by systems programmers in maintaining the operation of the system, rather than by programmers in doing application work on the system.


1.ICKDSF
ICKDSF ("Device Support Facility") installs, initializes and maintains DASD, either under an operating system, or standalone.


2.IEHINITT
IEHINITT ("INITalize Tape") initializes tapes by writing tape labels. Multiple tapes may be labeled in one run of the utility. IBM standard or ASCII labels may be written.
An example of an IEHINITT program:
//IEHINITT JOB ACCT,'LABEL TAPES',MSGCLASS=J,CLASS=A
//STEP0001 EXEC PGM=IEHINITT,REGION=8M
//SYSPRINT DD SYSOUT=A
//LABEL DD DCB=DEN=2,UNIT=(3490,1,DEFER)
//SYSIN DD *
LABEL INITT SER=123450,NUMBTAPE=3
/*
This example will label 3 tapes on a 3490 magnetic tape unit. Each tape will receive an IBM standard label. The VOLSER will be incremented by one for each tape labeled. Each tape will be rewound and unloaded after being labeled.


3.IEHLIST
IEHLIST is a utility used to list entries in a Partitioned Dataset (PDS) directory or to list the contents of a Volume Table of Contents (VTOC).
The IEHLIST utility is used to list the entries contained in any one of the following:
PDS directory


VTOC
Catalog (OS CVOL)
An example of an IEHLIST program:
//IEHLIST JOB ACCT,'LIST PDS',MSGCLASS=J,CLASS=A
//STEP0001 EXEC PGM=IEHLIST,REGION=8M
//SYSPRINT DD SYSOUT=A
//PDS1 DD DSN=xxxx.yyyy.zzzz,DISP=OLD
//SYSIN DD *
LISTPDS DSNAME=xxxx.yyyy.zzzz,FORMAT
/*
This job will produce a formatted listing of the PDS directory of the PDS named xxxx.yyyy.zzzz.
An example of an IEHLIST program to list a VTOC is very similar:
//IEHLIST JOB ACCT,'LIST VTOC',MSGCLASS=J,CLASS=A
//STEP0001 EXEC PGM=IEHLIST,REGION=8M
//SYSPRINT DD SYSOUT=A
//VOL1 DD VOL=SER=vvvvvv,DISP=OLD
//SYSIN DD *
LISTVTOC VOL=vvvvvv,FORMAT
/*
5.IEHMOVE
IEHMOVE moves or copies collections of data. However, IBM does not recommend using the IEHMOVE utility in a DFSMS environment. A move differs from a copy in that during a move the original data set is deleted, or scratched. Some of the tasks that IEHMOVE can perform include the following:
Moving or copying sequential and partitional data sets
Moving or copying multi- volume data sets
Moving an entire volume of data sets
On the surface, IEHMOVE may seen redundant to the IEBGENER and IEBCOPY utilities. However, IEHMOVE is more powerful. The main advantage of using IEHMOVE is that you do not need to specify space or DCB information for the new data sets. This is because IEHMOVE allocates this information based on the existing data sets.
Another advantage of IEHMOVE is that you can copy or move groups of data sets as well as entire volumes of data. Because of the ease in moving groups of data sets or volumes, the IEHMOVE utility is generally favored by system programmers.
A sample IEHMOVE job:
//stepname EXEC PGM=IEHMOVE,PARM='LINECNT=xx,POWER=n'
//SYSPRINT DD SYSOUT=class
//SYSUT1 DD UNIT=aaaa,VOL=SER=bbbbbb,DISP=OLD
//anyname1 DD UNIT=cccc,VOL=SER=dddddd,DISP=OLD
//anyname2 DD UNIT=eeee,VOL=SER=ffffff,DISP=OLD
//SYSIN DD ...
The DD statements for IEHMOVE, order than SYSPRINT and SYSIN, refer to DASD or tape volumes instead of individual data sets. However, referencing volumes can pose a problem, since specifying DISP=OLD gains exclusive access to a volume. Therefore, while your IEHMOVE job runs, that entire volume (and all datasets on it) is unavailable to other users. This is acceptable for private volumes, such as tape volumes or mountable volumes, but unacceptable public volumes, such as DASD volumes.
The SYSUT1 DD statement specifies a DASD volume where three work data set required by



IEHMOVE are allocated. You must specify unit and volume information for this DD statement.
IEHMOVE was one of the first systems to be developed in PL/S.


4.IEHPROGM
IEHPROGM builds and maintains system control data. It is also used for renaming and scratching (deleting) a data set.
Some of the tasks that IEHPROGM can perform include the following:
Deleting (scratching) a data set or PDS member
Renaming a data set or PDS member
Cataloging or uncataloging a data set
Maintaining data set passwords
For cataloging:
//SYSIN DD *
CATLG DSNNAME=data-set-name,
VOL=device-name=volume-number
/*
//

6.1.09

MAINFRAME










Mainframe Introduction
In this Mainframe tutorial you will learn about mainframes and its concepts and some of the early mainframes describing the evolution and history of mainframes in detail. History and Evolution of Mainframes, Mainframe Channel, Direct Access Storage Device - DASD and Logical Partition - LPAR
What is Mainframe?
As we all know the term mainframe when said to a layman would give a feeling of a large computer, but the question arise how large it is and what is the specialty of these mainframes. The answer to this question lies in the term "Mainframe" itself. As the name implies mainframe is the main computer with all units processing, communications are built into a frame and hence the name Mainframe, which thereby denotes a very large computer.
Mainframes have huge processing and storage capacity. The development cost involved with mainframes is also very huge and therefore mainframes are manufactured only by very large companies. Mainframe gets its usage and applications in banking and financial sectors where large-scale operation with millions of records per day is involved. Apart from the above there is also enterprise class mainframe integration which has greater features and ability of connecting mainframe data sources to distributed platforms.
Thus, with specific, specialized and powerful features of mainframes like security, high performance, reliability, scalability and manageability are achieved and provided to distributed applications using mainframe resources.
History and Evolution of Mainframes:
Some of the early mainframes which were developed starting from the year of 1942 are ENIAC, MARK1, BINAC, UNIVAC. ENIAC is also called as electronic numerical integrator and calculator was developed in the year 1942. This mainframe machine weighed in tones and consumed enormous electric power.
It had thousands of vacuum tubes, relays resistors, capacitors, and inductors inside it. In the year 1951, UNIVAC-I was developed specially for the US Census Bureau. The major difference between UNIVAC and ENIAC was the processing of digits. In UNIVAC, processing was done in serial mode, yet the speed of UNIVAC was higher than ENIAC with one disadvantage of vacuum tubes generating enormous amount of heat which made the mandatory requirement of a large good air conditioning system.
Later in 1954, Univac II was developed. In 1962, the concept of virtual memory, a powerful feature which shall be discussed in later sections, was introduced in mainframes making the system even more powerful. In 1964, the first third generation computer named as Burroughs B5000 came into market. This mainframe system had various powerful specialized features like multiprogramming, multiprocessing and virtual memory.

Later on various improved versions of Burroughs series came into market with new features in each. Among this the most notable one was B6700 which came in the year 1971 and this supported the feature of dynamic linking of programs at runtime.
IBM was producing and releasing mainframes in the market at all periods from past till present with the successive development of IBM Series starting with System/360. One of the biggest factors associated with mainframes is its huge cost which made its usage only possible for big companies and corporate. There are still many technical terms one must get familiarized with mainframe systems to understand about mainframe systems in depth.
Let us see some of the internal technical usage of mainframe system.
Mainframe Channel:
A mainframe channel connect to one or more controllers via either pairs of large "bus and tag" cables or, fiber optic ESCON (Enterprise System CONnection) cables and FICON, which has the ability controlling one or more devices. This is one of the important term in mainframe technology since it has the ability of take care of huge input and output functions.

DASD:
DASD stands for Direct Access Storage Device. This indicates to any type of storage that was directly (randomly) addressable.

LPAR:
LPAR stands for Logical Partition and is a powerful hardware or firmware feature implemented in all mainframe systems. By this feature it is possible to create partitions and by which CPUs and I/O sub-systems can be shared between logical partitions.
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,
JCL , used to run a cobol program

//JOB1 JOB (034D),'RAMESH KRISHNA REDDY',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.

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)

Three important input operations are
1. JOB
2. EXEC
3. DD


1.JOB statement

EXPLANATION to keyword parameters
1.CLASS
2.PRTY
3.MSGCLASS
4.MSGLEVEL
5.TYPRUN
6.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

2.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
1.PARM
2.ACCT
3.ADDRSPC
4.DPRTY
5.PERFORM
6.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
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

NOTE
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 conditioncode and initiate the second jcl.


PARAMETERS IN BOTH STATEMENTS (JOB and EXEC)
1.COND
2.REGION
3.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


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

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

Example JCL -> //MYJOB JOB (AE32),'RAMESH'
//STEP1 EXEC PGM=COBPROG,
// REGION=67K

NOTE:All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

2.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)

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

Syntax -> //ddname DD <>

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 ->

DISP=(STATUS,NORMAL,ABNORMAL)

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=<>

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