Copy PDS Members Using the EXCLUDE and SELECT Parameters (z/OS to z/OS)

In this example, the data set, PDS.SOURCE, contains the following members:

A, AB, ABA, ABB, ABC, ABD, ABE, ACB, ACC, ACD, BAA, BAB, BAC, CDE, CDF

This COPY statement shows the use of the SELECT and EXCLUDE parameters:

COPY  FROM  (DSN=PDS.SOURCE                      -
             SELECT=((BA/BBB),A*,ABC,(CDF,ZZZ))  -
             EXCLUDE=(AC*,BAA,(ABC/AZ)))         -
      TO    (DSN=PDS.DEST)

Results are as follows:

  • A, AB, ABA, ABB are copied because they are generically selected by A*.
  • ABC is copied because a specific ABC selection overrides the EXCLUDE range (ABC/AZ).
  • ABD and ABE are not copied because they are excluded by the range ABC/AZ.
  • ACB, ACC, and ACD are not copied because they are excluded generically by AC*.
  • BAA is not copied because the specific BAA EXCLUDE overrides the SELECT range (BA/BBB).
  • BAB and BAC are copied because they are selected by the range (BA/BBB).
  • CDE is not copied because it is not selected.
  • CDF is copied because it is specifically selected by (CDF,ZZZ); ZZZ is the new name.