Compressing a PDS

  • A PDS may contain unused space where a deleted member or the old version of an updated member exists.
  • The unused space is reused when a PDS is copied to a new PDS or after a compress operation completes.
  • The compress operation performs by a COPY statement where both source and target PDS are the same without the SELECT / EXCLUDE.
  • The compress operation is performed in the same relative order as the DDnames in the input list.

Practical Example -

Scenario - Compress a PDS.


//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 -

    - 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.