Copying Data Sets
Copying Data Sets
Summary
For basic information, go through the IEBCOPY Utility (for Beginners)
- IEBCOPY is used to copy a PDS from one volume to another fully or partially.
- If the data set name changes, the new data set can be on the same volume.
- Suppose the data set name is not different. In that case, IEBCOPY assumes the request is compressed and also assumes that the SELECT / EXCLUDE statements are not coded.
- Members are copied in the same physical order as how they exist in the input data set.
Practical Example -
Scenario - Copy from one dataset to another resides on different volume.
JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKC JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//*****************************************************************
//* TO COPY PDS DATA SET ANOTHER PDS DATA SET ON DIFFERENT VOLUME
//*****************************************************************
//STEP10 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS,DISP=SHR
//SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTPDS,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10,10),RLSE),
// UNIT=3390,VOL=SER=DEVHD4,
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
**************************** Bottom of Data ****************************
Job Status -

Output -

Explaining Example -
- SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS - Specifies the input PDS and resides on the volume STRVL2.
- SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTPDS,.. - Specifies the output new PDS and creating on the volume DEVHD4.
- COPY INDD=SYSUT1,OUTDD=SYSUT2 - Copies all members from SYSUT1 to SYSUT2. Both input and output datasets are on different volumes.