Unloading PDS


IEBCOPY COPY statement is used to unload a PDS to PS file for creating a backup. It re-creates PDS from an unloaded PS. A COPY operation can create an unloaded PS, whereas COPYMOD cannot. UNLOAD and LOAD operations requests are very similar to a COPY operation.

When we unload a dataset, we extract data from the dataset and write it to an output file. This can be useful for creating full backups or specific members.

Practical Example -


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

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//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.