COMPRESS A PDS.

JES2/3, JCL, utilities.
Post Reply
Sushil
Registered Member
Posts: 23
Joined: Sat Nov 23, 2013 2:56 am

COMPRESS A PDS.

Post 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                                            
//*                                                                     
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COMPRESS A PDS.

Post by nicc »

As long as it is not being updated it should be OK.
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COMPRESS A PDS.

Post 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.
Sushil
Registered Member
Posts: 23
Joined: Sat Nov 23, 2013 2:56 am

Re: COMPRESS A PDS.

Post by Sushil »

Thanks. Yes I was also thinking that we are not using PDSE.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”