Unloading PDS to PS Example


Scenario - Unload a PDS to a backup a PS.

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.