IEBCOPY Copying Members Have Alias Names
The COPY or COPYGRP statement is used to copy members with alias names from one PDS (or PDSE) to another.
Rules -
- All members with their aliases are copied if they copy an entire PDS to a new one.
- If merging a PDS with another, members or aliases will not change on the output PDS.
- When selectively copying, we need to specify every member name, including their aliases.
- To exclude a member, we should specify that member's name and all of its alias names to exclude it from the copy operation.
Syntax -
//SYSIN DD *
[label] COPY OUTDD=DDname
,INDD=[(]{DDname|(DDname,R) }[,...][)]
[LIST={YES|NO}]
/*
- OUTDD=DDname - Specifies the DDname of the output PDS.
- INDD=[(]{DDname|(DDname,R) }[,...][)] - Specifies the DDname of the input PDS.
- R - Specifies that the members to be copied or loaded from the input PDS will replace any identically named members on the output PDS.
- LIST={YES|NO} - Specify the altered member names to be listed in the SYSPRINT dataset. When ignored, the default listing option from the EXEC PARM gets applied.
Practical Example -
Scenario - Copying member (COPY) and its alias (COPYALIA) from one PDS to another.
Input -

JCL -
----+----1----+----2----+----3----+----4----+----5----+
//MATEPKC JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//***********************************************
//* COPY MEMBER AND ITS ALIAS
//***********************************************
//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,FSTALIAS)
/*
Job Status -

Output -

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,FSTALIAS) - Copies member FIRSTPRG and its alias FSTALIAS from SYSUT1 to SYSUT2.