EXCLUDE


Summary

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

  • The EXCLUDE statement is used to exclude the members from the copy, unload, or load operation.
  • EXCLUDE statement always comes with COPY statement.
  • An EXCLUDE statement cannot appear with a SELECT statement, compress, or COPYGRP.

Syntax -


//SYSIN     DD  *
  	[label] EXCLUDE MEMBER=[(]name1[,name2][,...][)]
/*
  • MEMBER=[(]name1[, name2][,...][)] - Specifies members on the input data set that should exclude while copying, unloading, or loading to the output data set.

Practical Example -


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

Input -

EXCLUDE Input

JCL -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKE  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,PGMIDTST)                                 
/*                                                                      
**************************** 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,PGMIDTST)
    - Copies all other members except MAINPROG, PGMIDTST from SYSUT1 to SYSUT2.