IEBCOPY is a data set utility that is used to copy or merge members between one or more partitioned data sets.
IEBCOPY is used to perform the following tasks:
IEBCOPY – To copy as a PDS
It is often used to expand the space allocation or change the directory space. For example, to increase the directory blocks
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=Existing PDS name,DISP=(SHR,Delete) (say, this PDS has 10 directory blocks) //SYSUT2 DD DSN=New PDS name, // // SPACE=(TRK,(10,5,50),RLSE), //SYSIN DD * COPY INDD=SYSUT1,OUTDD=SYSUT2 /*
You can merge many input PDSs too. DDnames are necessary for merge. Using IEBCOPY can be used to alter the BLKSIZE but not the LRECL.
IEBCOPY – To copy to a new PDS
To copy selective members from a PDS to a new PDS use SELECT MEMBER or EXCLUDE MEMBER in the control statement along with COPY operation. Select and Exclude are mutually exclusive.
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=Existing PDS name,DISP=SHR //SYSUT2 DD DSN=New PDS name,DISP=(New,Catlg), // …………………………… //SYSIN DD * COPY INDD=SYSUT1,OUTDD=SYSUT2 SELECT MEMBER=(member1,member2……..) /*
You can assign a new name to the copied member SELECT MEMBER=(member1,(member2,newname), ……..)
For a COPY operation on an PDS with existing members, you can replace identically named members in the output dataset SELECT MEMBER=(member1,,R)
IEBCOPY – To compress a PDS
Partioned data sets are compressed to free up unused space which can be reused for something else.
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //INOUT DD DSN=Existing PDS name,DISP=Old //SYSIN DD * COPY INDD=INOUT,OUTDD=INOUT /*
Since input and output datasets are the same, must code COPY control statement.
IEBCOMPR utility program is used to locate the data differences between two datasets by comparing at record level data. This program can be used to compare two sequential or partitioned datasets.
//STEP010 EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=<Dataset1>,DISP=Old //SYSUT2 DD DSN=<Dataset2>,DISP=Old //SYSIN DD * COMPARE TYPORG=PO /*
The Return Code (RC) of 0 implies no data-differences and Return Code (RC) of 8 implies differences.