[◀ JCL Batch Jobs]

Contents

  1. Copying a partitioned dataset
  2. Copying members

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))
/*

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

Wir benutzen Cookies um die Nutzerfreundlichkeit der Webseite zu verbessen. Durch Deinen Besuch stimmst Du dem zu.