Selecting Members for Copy/Unload/Load


Summary

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

  • IEBCOPY is used to copy, unload and load selected members from one or more data sets.
  • The SELECT statement needs to be coded along with IEBCOPY to filter the members.
  • SELECT and EXCLUDE statements can’t be used in the same copy operation.
  • Selected members are searched for in aa-to-z collating sequence, regardless of the order in the SELECT statement.
  • The members are copied in the same physical sequence appearing on the input PDS or PDSE.
  • Members can be renamed while copying unless the input and output data sets are identical.
  • Once a member in a SELECT statement is found in an input data set, no further search is done for it.
  • When using COPYGRP, use SELECT MEMBER name filter pattern masking instead of specifying a full member name. The filter characters asterisk (*) and percent sign (%) provide the member name filtering capability.

Practical Example -


Scenario - Copying members (COPY) from one PDS to another.

JCL -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKS  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),           
//             NOTIFY=&SYSUID                                           
//***************************************************                   
//* SELETING MEMBER(S) FROM INPUT PDS DURING COPY                       
//***************************************************                   
//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                                      
     SELECT MEMBER=FIRSTPRG,IDENTDIV,LEVELNUM                           
/*                                                                      
**************************** Bottom of Data ****************************

Job Status -

Selecting Members for Copy

Output -

Selecting Members for Copy

Explaining Example -

  • SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS - Specifies the input PDS.
  • SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTPDS - Specifies the output PDS.
  • COPYGRP INDD=SYSUT1,OUTDD=SYSUT2 - Copies members from SYSUT1 to SYSUT2.
  • SELECT MEMBER=FIRSTPRG,IDENTDIV,LEVELNUM - Copies member FIRSTPRG,IDENTDIV and LEVELNUM from SYSUT1 to SYSUT2.