Unloading Data Sets


Summary

For basic information, go through the IEBCOPY Utility (for Beginners)

  • IEBCOPY is used to unload a PDS to a sequential data set.
  • IEBCOPY re-creates PDS from an unloaded data set by specifying physical organization (DSORG=PO and DSNTYPE=PDS or DSNTYPE=LIBRARY) for the output data set.
  • A COPY operation can unload data set, whereas COPYMOD cannot.
  • The unloaded PS file can re-create multiple output PDS.
  • For unload and load operations, requests are handled similarly to a copy operation.

Practical Example -


Scenario - Unload a PDS to a PS.

JCL -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//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                                      
/*                                                                      
**************************** Bottom of Data ****************************

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.