Copy a PDS Using the ALIAS Parameter with SELECT and EXCLUDE (z/OS to z/OS)

This COPY statement shows how the ALIAS parameter works when other optional parameters are specified.

COPY  	FROM  (DSN=PDS.SOURCE  -
              ALIAS=Y         -
              EXCLUDE=C3      -
              SELECT=(A,C1))  -
       TO    (DSN=PDS.DEST)

In this example, the data set PDS.SOURCE has the following members and associated aliases:

Members Aliases
A A1 A2
B  
C C1 C2 C3

The data set PDS.DEST contained no members and no aliases before the COPY operation. After the COPY operation, PDS.DEST contains the following members and aliases:

Members Aliases
A A1 A2
C C1 C2

The explanation follows:

  • A is copied because it was selected by member name.
  • A1 is copied because ALIAS=Y and A1 is an alias for member A.
  • A2 is copied because ALIAS=Y and A2 is an alias for member A.
  • B is not copied because it was not selected.
  • C is copied because ALIAS=Y and C is the true member name for C1.
  • C1 is copied because it was selected by member name.
  • C2 is copied because ALIAS=Y and C1 (another alias for member C) was selected by member name.
  • C3 is not copied because it was specifically excluded.