Excluding Members from a Copy


Summary

For basic information, go through the IEBCOPY Utility (for Beginners)

  • IEBCOPY excludes specified members during the copy, unload and load operation.
  • Members from one or more input data sets can be excluded from a copy, unload, or load operation.
  • The excluded member is searched for on every input data set and is omitted in the copy, unload, or load operation.
  • EXCLUDE statement is used to exclude the member during the COPY.
  • A maximum of eight characters can be allowed for the member or alias name on a copy operation. EXCLUDE is not allowed for COPYGRP.
  • The replace option can be specified on the data set level in an exclusive copy or load.

Practical Example -


Scenario - Excluding a members while copying from one PDS to another.

Input -

EXCLUDE Input

JCL -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),           
//             NOTIFY=&SYSUID                                           
//***********************************************************           
//* EXCLIDING MEMBERS WHILE COPY FROM ONE PDS TO ANOTHER                
//***********************************************************           
//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=OLD                        
//SYSIN    DD *                                                         
     COPY INDD=SYSUT1,OUTDD=SYSUT2                                      
     EXCLUDE MEMBER=MAINPROG                                            
/*                                                                      
**************************** Bottom of Data ****************************

Job Status -

EXCLUDE Job Status

Output -

EXCLUDE Output

Explaining Example -

  • SYSUT1 DD DSN=MATEPK.IEBCOPY.INPLOAD - Specifies the input load PDS.
  • SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTLOAD,.. - Specifies the output load PDS.
  • COPY INDD=SYSUT1,OUTDD=SYSUT2
    EXCLUDE MEMBER=MAINPROG
    - Copies all other members except MAINPROG from SYSUT1 to SYSUT2.