MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compress a VSAM Dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
GuruRaj
Beginner


Joined: 19 Dec 2003
Posts: 21
Topics: 15

PostPosted: Fri Feb 06, 2004 9:20 am    Post subject: Compress a VSAM Dataset Reply with quote

hi
can any one tell me how to compress a volume and compress vsam dataset.
Back to top
View user's profile Send private message Send e-mail
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Fri Feb 06, 2004 9:36 am    Post subject: Reply with quote

1/ Compress volume: There are various utilities for doing this but it would normally be done either as routine or when required, by your storage admin group (e.g. the people you would go to if you needed more DASD space etc.). Doing it yourself without fully understanding what you are doing could cause all sorts of trouble (e.g. I believe some products can move datasets which are 'in use' unless you tell them not to, this could cause an online system to crash, for example).

2/ Compress VSAM dataset: I guess you are referring to a reorganization (reorg) which will defragment a VSAM file with lots of CI/CA splits. This is typically done using IDCAMS (see 'DFHSMS access method services' manual) to create/copy/rename a new file. The steps involve the concept of a current file (the file you want to compress), a .OLD file and a .NEW file:
a/ Use DELETE CLUSTER to delete 'vsamfile.OLD' from previous compress
b/ Use DEFINE CLUSTER with MODEL to create a 'vsamfile.NEW' modelled on the current file
c/ Use REPRO to copy current file to .NEW file.
d/ Use ALTER to rename each of the 3 components (base,index,data) of the current file to .OLD
e/ Use ALTER to rename each of the 3 components (base,index,data) of the .NEW file to become the 'current' file.

Steps a/,b/, and c/ can be done in a single IDCAMS JCL step; then do steps d/ and e/ in a second IDCAMS step which should only be run if the previous step suceeds. This means the reorg will 'fail safe' - if the new file fails to be created for any reason the renames will not occur and you will still have a working 'current' file.

If you want to do this process 'manually' as a one-off, you can use FILEAID to perform equivalent operations very easily if you have this product.
Back to top
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Fri Feb 06, 2004 10:00 am    Post subject: Reply with quote

Here's a sample REORG for file MYNODE.TESTVSAM:
Code:

//S10    EXEC PGM=IDCAMS                                               
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  DELETE (MYNODE.TESTVSAM.OLD) CLUSTER PURGE                           
  DEFINE    CLUSTER                               -                   
                (NAME(MYNODE.TESTVSAM.NEW) -                           
                MODEL(MYNODE.TESTVSAM)) -                             
            DATA-                                                     
                (NAME(MYNODE.TESTVSAM.NEW.DATA)) -                     
            INDEX-                                                     
                (NAME(MYNODE.TESTVSAM.NEW.INDEX))                     
   REPRO INDATASET(MYNODE.TESTVSAM) -                                   
       OUTDATASET(MYNODE.TESTVSAM.NEW)                                 
//*------------------------------------------------------
//S20    EXEC PGM=IDCAMS,COND=(0,LT,S10)                     
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                             
 ALTER MYNODE.TESTVSAM -                                     
        NEWNAME(MYNODE.TESTVSAM.OLD)                         
 ALTER MYNODE.TESTVSAM.INDEX -                               
        NEWNAME(MYNODE.TESTVSAM.OLD.INDEX)                   
 ALTER MYNODE.TESTVSAM.DATA -                               
        NEWNAME(MYNODE.TESTVSAM.OLD.DATA )                   
 ALTER MYNODE.TESTVSAM.NEW -                                 
        NEWNAME(MYNODE.TESTVSAM)                             
 ALTER MYNODE.TESTVSAM.NEW.INDEX -                           
        NEWNAME(MYNODE.TESTVSAM.INDEX)                       
 ALTER MYNODE.TESTVSAM.NEW.DATA -                           
        NEWNAME(MYNODE.TESTVSAM.DATA )                       
//                                                           
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group