0% found this document useful (0 votes)
29 views7 pages

Utilities of Mainframe

The document provides an overview of several main utilities used in JCL, including IEFBR14 for deleting files, IEBCOPY for copying and compressing PDS, IEBGENER for copying and concatenating datasets, and IEHPROGM for maintaining datasets and system control data. It includes sample JCL code for each utility, detailing their specific functions and usage. The document serves as a reference for efficiently managing datasets in a mainframe environment.

Uploaded by

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

Utilities of Mainframe

The document provides an overview of several main utilities used in JCL, including IEFBR14 for deleting files, IEBCOPY for copying and compressing PDS, IEBGENER for copying and concatenating datasets, and IEHPROGM for maintaining datasets and system control data. It includes sample JCL code for each utility, detailing their specific functions and usage. The document serves as a reference for efficiently managing datasets in a mainframe environment.

Uploaded by

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

Main Utilities

IEFBR14

Every time during Testing we encounter errors due to which we have to make
modifications and rerun the job. It has been a regular practice that we always tend to do
TSO DEL 'File name' and never include a simple IEFBR14 step.
Now all you have to do is just Copy and Paste the code into your JCL and proceed ahead
without any warnings like "FILE IS ALREADY CALALOGED"

//*******************************************************//*
IEFBR14
//*******************************************************//
DD1 EXEC PGM=IEFBR14
//DELDD DD DSN=<< input file name >>,
// DISP=(MOD,DELETE,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(1,1))
//*******************************************************

IEFBR14 is also used to delete Temporary Work files

//
*********************************************************//*
IEFBR14 - DELETE WORK FILES
//
*********************************************************//
PS160 EXEC PGM=IEFBR14
//DD1 DD DSN=TCEX.WORK.A186P010.VALPTEMP,
// DISP=(OLD,DELETE)
//DD2 DD DSN=TCEX.WORK.A186P020.SRT,
// DISP=(OLD,DELETE)
//DD3 DD DSN=TCEX.WORK.A186P040.VALPTEMP,
// DISP=(OLD,DELETE)
**************************************************************************************

IEFBR14 is also used to delete Files that are on TAPE

//**************************************************
//* IEFBR14 - *DELETE GDG BASED FILES *
//**************************************************
//PS500 EXEC PGM=IEFBR14
//DD1 DD DSN=TCEX.Q213P110.F03A.G0003V00,
// DISP=(OLD,DELETE)
//DD2 DD DSN=TCEX.Q213P110.F03A.G0004V00,
// DISP=(OLD,DELETE)
//DD3 DD DSN=TCEX.Q213P110.F03A.G0005V00,
// DISP=(OLD,DELETE)
//DD4 DD DSN=TCEX.Q213P110.F03A.G0006V00,
// DISP=(OLD,DELETE)

BACK
________________________________________________________________________

IEBCOPY

IEBCOPY is used to copy all or part of a Partitioned Data Set (PDS) . Selected members
of a PDS can be copied to another or the same PDS and/or renamed. A sequential
backup copy of a PDS can be made. IEBCOPY is used to "compress" a PDS when all of
its unused internal space has been exhausted. The compress operation reorganizes a
PDS so that all previously unused space inside the PDS is reclaimed.
Sample IEBCOPY JCL:

//JS10 EXEC PGM=IEBCOPY,REGION=1024K,


// PARM='SIZE=nnnnnnnnK' Optional PARM
//SYSPRINT DD SYSOUT=* IEBCOPY Messages
//ddname1 DD DSN=...,DISP=... Input File
//ddname2 DD DSN=...,DISP=... Output File
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE) Work file 1
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE) Work file 2
//SYSIN DD * Control Statements
control statements...
/*

Valid control statements are


1) COPY
1) SELECT
2) EXCLUDE

COPY:- COPY:
This statement indicates the beginning of a copy operation and
Identifies the DD statements to be used during the copy. The
format of the COPY control statement is:

Format:
{label} COPY OUTDD=ddname, (OUTPUT FILENAME)
INDD=(ddname1,ddname2,(ddname3,R),...)
(INPUT FILENAME)
{,LIST=NO}
--------------------------------

The LIST=NO keyword is optional and tells IEBCOPY that you don't want a list of the
members in the PDS.

COPY can be abbreviated as 'C', OUTDD as 'O', and INDD as 'I'.

Note : When copying from a sequential file or a PDS to another PDS, specify the 'R'
parameter after the input DD name if you want ALL identically named members replaced
on the output file.

Examples.

Identically named members are only replaced on a copy operation


if you request the REPLACE option on the COPY statement, or on
the SELECT statement, described later.
COPY Statement EXAMPLES follow:

Example 1 - Copy all with replace.

{label} COPY OUTDD=O,INDD=((I,R))


--------------------------------

Example 2 - Copy without replace.

{label} C O=TAPE,I=DASD
--------------------------------

Example 3 - Compress-in-place!

{label} COPY OUTDD=SYSUT1,I=SYSUT1


--------------------------------

SELECT:
The SELECT statement is used to name members to be included in a copy operation.
The SELECT statement must be preceded by a COPY or COPYMOD statement, or the
INDD= portion of a COPY statement. A SELECT statement may not appear in the same
COPY operation as an EXCLUDE statement, neither can SELECT be used in a compress
operation. A SELECT member is only replaced in the output data set if the REPLACE
option ('R') is set on the SELECT statement or on the INDD portion of the COPY
statement. Possible formats of the SELECT control statement are:

Format 1 - Copy selected members.


{label} SELECT MEMBER=name
- -------------------------------
Format 2 - Copy a list of members.

{label} SELECT MEMBER=(name1,name2,name3...)


--------------------------------

Format 3 - Copy a list of members and rename them.

{label} SELECT MEMBER=((name1,newname1),


(name2,newname2),...)
--------------------------------

Format 4 - Copy a list of members and replace them if they


are already in the output data set.

{label} SELECT MEMBER=((name1,,R),(name2,,R),...)


--------------------------------

EXCLUDE:
The EXCLUDE statement is used to name members to be excluded
from A copy operation. The EXCLUDE statement must be preceded
by a COPY or COPYMOD statement, or the INDD= portion of a COPY
statement. An EXCLUDE statement may not appear in the same COPY
operation as a SELECT statement, neither can EXCLUDE be used in
a compress operation. The format of the SELECT control statement
is:

Format -

{label} EXCLUDE MEMBER=(name1,name2,name3,...)

IEBCOPY Usage Examples:

JCL to compress a PDS:

//JS10 EXEC PGM=IEBCOPY,REGION=1M


//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds, same PDS for I1 & O1
// DISP=OLD
//*
//O1 DD DSN=my.pds,
// DISP=OLD
//SYSIN DD *
COMP1 C O=O1,I=((I1,R))

OR

//COMPRESS EXEC PGM=IEBCOPY,REGION=0K


//SYSPRINT DD SYSOUT=*
//PDSIN DD DSN=PUFAP.PARMLIB.CYCLE,DISP=SHR
//PDSOUT DD DSN=PUFAP.PARMLIB.CYCLE,DISP=OLD
//SYSIN DD DSN=PAEPC.Y2K.SYSIN(APUF00D1),DISP=SHR
COPY INDD=PDSIN,OUTDD=PDSOUT
________________________________________________________________________

JCL to unload a PDS to a tape:

//STEP1 EXEC PGM=IEBCOPY,REGION=1024K


//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds, PDS to unload
// DISP=OLD
//*
//O1 DD DSN=my.pds.tape.copy, tape to unload PDS
// DISP=(,CATLG),
// UNIT=TAPE,
// VOL=SER=
//SYSIN DD *
COPY1 C O=O1,I=((I1,R))
________________________________________________________________________
JCL to load a PDS to DASD from a sequential unloaded copy:

//PDSLOAD EXEC PGM=IEBCOPY,REGION=1M


//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds.seq.copy,DISP=OLD
//* previously unloaded copy
//*
//O1 DD DSN=my.pds,
//* PDS being created on DASD
// DISP=(,CATLG),
// UNIT=SYSDA,
// SPACE=(TRK,(30,30,10),RLSE)
//SYSIN DD *
COPY1 C O=O1,I=((I1,R))
________________________________________________________________________
JCL to copy 4 members from one PDS to another:

//PDSCOPY EXEC PGM=IEBCOPY,REGION=1024K


//SYSPRINT DD SYSOUT=*
//I1 DD DSN=my.pds.input, copy from here
// DISP=SHR
//*
//O1 DD DSN=my.pds.output, to here
// DISP=SHR
//SYSIN DD *
COPY1 C O=O1,I=((I1,R))
SELC1 S M=MEMBER1,MEMBER2
SELC2 S M=((MEMBER3,NEWMEM3),MEMBER4) rename MEMBER3 to NEWMEM3

BACK
________________________________________________________________________
IEBGENER

This utility is to copy, concatenate and to empty sequential datasets:-

Example for Copy:

//*---------------------------------------------------
//step01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=&LEVL1.CCL.NN1.CCLC120(+1),
// DISP=SHR
//SYSUT2 DD DSN=&LEVL1.CCL.NN1.CCLC120.FTP,
// DISP=MOD
//SYSIN DD DUMMY
//*---------------------------------------------------

Example for Concatenation:

//*---------------------------------------------------
//step01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=&LEVL1.CCL.NN1.CCLC120(+1),
// DISP=SHR
// DD DSN=&LEVL1.CCL.NN1.CCLC121(+1),
// DISP=SHR
//SYSUT2 DD DSN=&LEVL1.CCL.NN1.CCLC120.FTP,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE)
//*---------------------------------------------------

Example to Empty Existing Data.

//*---------------------------------------------------
//step01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSUT2 DD DSN=&LEVL1.CCL.NN1.CCLC120.FTP, //
DISP=SHR
//SYSIN DD DUMMY
//*---------------------------------------------------

BACK

________________________________________________________________________
IEHPROGM

IEHPROGM is used to maintain data sets and system control data.


The IEHPROGM utility can be used to:

1) Either scratch a data set or PDS/PDSE members


2) Either rename a data set or PDS/PDSE members
3) Change the OS CVOL for a non-VSAM data set
through cataloging or uncataloging entries, building
or deleting indexes or aliases, or creating and
manipulating GDG indexes
4) Two OS CVOLs can be connected or released
5) Data set passwords maintenance

Please refer QW for getting Detail Information, Syntax about


IEHPROGM

BACK

________________________________________________________________________

You might also like