Utilities of Mainframe
Utilities of Mainframe
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 - 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 - *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:
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.
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.
{label} C O=TAPE,I=DASD
--------------------------------
Example 3 - Compress-in-place!
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:
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 -
OR
BACK
________________________________________________________________________
IEBGENER
//*---------------------------------------------------
//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
//*---------------------------------------------------
//*---------------------------------------------------
//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)
//*---------------------------------------------------
//*---------------------------------------------------
//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
BACK
________________________________________________________________________