IEBCOPY Selecting Members for Copy/Unload/Load

IEBCOPY Loading/Copying from Unload Data Sets Excluding Members from a Copy

Advertisements


IEBCOPY can be used to copy, unload and load selected members.

Select specific members to be processed from one or more data sets.

SELECT statement needs to be coded along with IEBCOPY to name the members.

EXCLUDE statement used to ignore some members from processing.

SELECT and EXCLUDE statements can’t be used in the same copy operation.

A maximum of eight characters can be allowed for the member or alias name on a 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 in which they appear on the input partitioned data set or PDSE.

While copying, members can be renamed unless the input and output data sets are the same.

Once a member in a SELECT statement is found in an input data set, no further search is made for it.

When using COPYGROUP, 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.

When using COPYGROUP, if SELECT MEMBER name filter pattern masking specified and can also specify EXCLUDE MEMBER name pattern masking.

Otherwise, EXCLUDE is not supported with COPYGROUP.

Example:

A partitioned data set (DATASET1) is copied from one disk volume to another.


  //COPYDS   JOB   ...
  //STEP01 EXEC  PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //SYSUT1   DD  DSNAME=DATASET1,UNIT=disk,VOL=SER=111111,
  //             DISP=SHR
  //SYSUT2   DD  DSNAME=DATASET2,UNIT=disk,VOL=SER=111112,
  //             DISP=(NEW,KEEP),SPACE=(TRK,(5,1,2))
  //SYSIN    DD  *
       COPY INDD=(SYSUT1),OUTDD=SYSUT2 
       SELECT    MEMBER=B
  /*
  

Let’s discuss the example in detail.

  • SYSUT1 DD defines a PDS DATASET1 that contains three members (A, B and C).
  • SYSUT2 DD defines a new PDS DATASET2 that is to be kept after the copy operation.
  • Input and output data sets are identified as SYSUT1 and SYSUT2, the SYSIN data set is not needed.
  • The SYSUT1 data set will be copied to the SYSUT2 data set only B.
  • After the copy operation is finished, DATASET2 will contain the Bfrom DATASET1.

IEBCOPY Loading/Copying from Unload Data Sets Excluding Members from a Copy

Advertisements