Unloading PDS


  • IEBCOPY COPY statement is used to unload a PDS to PS to create backup.
  • IEBCOPY re-creates PDS from an unloaded PS by coding the output PDS physical organization (DSORG=PO and DSNTYPE=PDS or DSNTYPE=LIBRARY).
  • A COPY operation can create an unloaded PS, whereas COPYMOD cannot.
  • Multiple input PDS can unload into a single PS.
  • UNLOAD and LOAD operations requests are very similar to a COPY operation.

Practical Example -


Scenario - Unload a PDS to a PS or backup a PDS.

JCL -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//MATEPKU  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),           
//             NOTIFY=&SYSUID                                           
//***************************************************                   
//* UNLOAD PDS TO PS                                                    
//***************************************************                   
//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.UNLOADPS,                              
//            DISP=(NEW,CATLG,DELETE),                                  
//            SPACE=(TRK,(10,10),RLSE),                                 
//            UNIT=3390,VOL=SER=DEVHD4                                  
//SYSIN    DD *                                                         
     COPY INDD=SYSUT1,OUTDD=SYSUT2                                      
/*

Job Status -

EXCLUDE Job Status

Output -

EXCLUDE Output

Explaining Example -

  • SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS - Specifies the input PDS with members.
  • SYSUT2 DD DSN=MATEPK.IEBCOPY.UNLOADPS,.. - Specifies the unload output PS.
  • COPY INDD=SYSUT1,OUTDD=SYSUT2 - Unloads SYSUT1 data to SYSUT2.
Note! We can't browse or view MATEPK.IEBCOPY.UNLOADPS because of not specifying the Block format. However, the member's data still resides.