IEBCOPY renaming member while copying

EXAMPLE:

Renaming a Member While Copying

//IEBCOPY  JOB (12345),'RENAME COPY',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID  
//STEP1    EXEC PGM=IEBCOPY  
//SYSPRINT DD SYSOUT=*  
//SYSUT1   DD DSN=T12345.SOURCE.PDS,DISP=SHR  
//SYSUT2   DD DSN=T12345.TARGET.PDS,DISP=SHR  
//SYSIN    DD *  
  COPY OUTDD=SYSUT2,
  INDD=SYSUT1  
  SELECT MEMBER=((OLDNAME,NEWNAME)) 
/*  

Explanation:

EXEC Statement: Executes the IEBCOPY utility program to copy and rename members in a Partitioned Dataset (PDS).

DD Statement:

SYSUT1 DD: Specifies the source PDS (T12345.SOURCE.PDS) that contains the original member (OLDNAME).

SYSUT2 DD: Specifies the target PDS (T12345.TARGET.PDS) where the renamed member (NEWNAME) will be stored.

SYSPRINT DD: Outputs logs and messages generated by IEBCOPY to the system output.

SYSIN DD: Contains the control statements for the copy operation:

  • COPY OUTDD=SYSUT2, INDD=SYSUT1: Tells IEBCOPY to copy data from SYSUT1 to SYSUT2.

  • SELECT MEMBER=((OLDNAME, NEWNAME)): Instructs IEBCOPY to copy the member (OLDNAME) from the source PDS and rename it as (NEWNAME) in the target PDS.

This JCL copies a member named OLDNAME from the source PDS (T12345.SOURCE.PDS) and saves it into the target PDS (T12345.TARGET.PDS) with a new name NEWNAME

Last updated

Was this helpful?