Contents
Copying a partitioned dataset [▲ Top]
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1 EXEC PGM=IEBCOPY
//INPUTDS DD DISP=SHR,DSNAME=input.dataset.name
//OUTPUTDS DD DISP=SHR,DSNAME=output.dataset.name
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPYGRP INDD=INPUTDS,OUTDD=OUTPUTDS
/*
Copying members [▲ Top]
Use this sample to copy one or more members from a partitioned dataset to another.
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1 EXEC PGM=IEBCOPY
//INPUTDS DD DISP=SHR,DSNAME=input.dataset.name
//OUTPUTDS DD DISP=SHR,DSNAME=output.dataset.name
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=INPUTDS,OUTDD=OUTPUTDS
SELECT MEMBER=(membername1, membername2, ..., membernameN)
/*
Use EXCLUDE statement to specify which members to be excluded.
//*
//SYSIN DD *
COPY INDD=INPUTDS,OUTDD=OUTPUTDS
EXCLUDE MEMBER=(membername1, membername2, ..., membernameN)
/*
You can also merge members from two or more partitioned datasets.
Use option R for REPLACE.
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1 EXEC PGM=IEBCOPY
//INPUTDS1 DD DISP=SHR,DSNAME=input.dataset.name.no1
//INPUTDS2 DD DISP=SHR,DSNAME=input.dataset.name.no2
//OUTPUTDS DD DISP=SHR,DSNAME=output.dataset.name
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=(INPUTDS1,INPUTDS2),OUTDD=OUTPUTDS
SELECT MEMBER=(membername1, membername2, ..., membernameN)
SELECT MEMBER=((membername1,,R),(membername2,,R))
/*
Renaming members as you copying. Use R for REPLACE.
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1 EXEC PGM=IEBCOPY
//INPUTDS DD DISP=SHR,DSNAME=input.dataset.name
//OUTPUTDS DD DISP=SHR,DSNAME=output.dataset.name
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=INPUTDS,OUTDD=OUTPUTDS
SELECT MEMBER=((oldname1,,R))
SELECT MEMBER=((oldname1,newname1))
SELECT MEMBER=((oldname2,newname2,R))
SELECT MEMBER=((oldnameN,newnameN,R))
/*