Compressing a PDS


A PDS may contain unused areas from a deleted member, or the old version of an updated member exists. Compressing a PDS involves removing unused or deleted members and reclaiming space within the dataset. This helps in optimizing storage usage.

The input and output PDS should be same. Otherwise, the IEBCOPY assumes it as a copy operation.

Practical Example -


Scenario - Compress a PDS.

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//***********************************************
//* COMPRESS THE PDS
//***********************************************
//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.INPPDS,DISP=OLD
//SYSIN    DD *
  COPY OUTDD=SYSUT2,INDD=SYSUT1
/* 

Job Status -

Compress PDS Job Status

Explaining Example -

  • SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS
    SYSUT2 DD DSN=MATEPK.IEBCOPY.INPPDS
    - Specifies the PDS that needs to be compressed.
  • SYSIN DD - Has the control statements for processing the input.
  • COPY OUTDD=SYSUT2,INDD=SYSUT1 - INDD, OUTDD should be same to compress it.
Note! A PDS can be destroyed if IEBCOPY is interrupted during processing. Do not compress a PDS currently being used by more than one user.