Copy a PDS and Using a Range to Exclude PDS Members (z/OS to z/OS)

The following COPY statement copies an entire PDS but uses a range to exclude any members from AAB through BBC.

COPY  FROM  (DSN=PDS.SOURCE        -
             EXCLUDE=((AAB/BBC)))  -
      TO    (DSN=PDS.DEST)

The source file, PDS.SOURCE, contains the following members:

AAA, AAB, ABB, ABC, BBA, BBB, BBCA, BGG, XXX

Members AAA, BBCA, BGG, and XXX are copied. Members AAB, ABB, ABC, BBA, and BBB are not copied because they are within the range of members excluded in AAB/BBC. There is no member BBC to exclude; BBB was the last member in PDS.SOURCE within the specified range. Because BBCA is not part of the range to be excluded, it is copied. A generic range, like AAB*/BBC*, is not valid.

All range entries must be specified as subparameters and enclosed in parentheses.