Page 1 of 1

COMPRESS A PDS.

Posted: Fri Oct 12, 2018 2:25 pm
by Sushil
Hi,

Many a time we get the space error in a PDS and this is the JCL we are using to compress it. Is it fine to copy a PDS to itself for this purpose? If it is in use by someone, can not it create a problem?

Code: Select all

//********************************************************************* 
//* PURPOSE   - COMPRESS A PDS BY COPYING ITSELF TO ITSELF            * 
//********************************************************************* 
//STEP01   EXEC PGM=IEBCOPY,COND=(0,LT)                                 
//SYSUT1   DD DISP=SHR,DSN='TEST.SOME.LOADLIB'                          
//SYSPRINT DD SYSOUT=*,DCB=(RECFM=FB,BLKSIZE=8000)                      
//SYSIN    DD  *                                                        
  COPY OUTDD=SYSUT1,I=SYSUT1                                            
//*                                                                     

Re: COMPRESS A PDS.

Posted: Fri Oct 12, 2018 4:50 pm
by nicc
As long as it is not being updated it should be OK.

Re: COMPRESS A PDS.

Posted: Fri Oct 12, 2018 5:15 pm
by Robert Sample
Is it fine to copy a PDS to itself for this purpose?
Not only is it "fine", it is usual and accepted practice to do this. With DISP=SHR, there are times when you could have issues since someone updating the PDS while the compress is running could potentially corrupt the data set, requiring a restore from backup. Using DISP=OLD is the preferred method, but this is not always possible.

A better solution would be to convert the PDS to PDSE, since a PDSE does not require compressing.

Re: COMPRESS A PDS.

Posted: Thu Oct 18, 2018 4:18 pm
by Sushil
Thanks. Yes I was also thinking that we are not using PDSE.