IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

want to clear all the versions in a GDG


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anu_kannu

New User


Joined: 20 Sep 2005
Posts: 6

PostPosted: Tue Sep 20, 2005 11:20 am
Reply with quote

Hi all,
Im new to the forum.. I have a query..

How could I clear the data from all the versions of a GDG?

please help
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Tue Sep 20, 2005 12:03 pm
Reply with quote

In a Generation Data Group (GDG), there is the GENERATION:

HLQ.MY.GDG.G0001V00

and there is the VERSION:

HLQ.MY.GDG.G0001V00

What exactly do you mean by "Clear all the Versions"?

To clear all the Generations, a simple DISP=(OLD,DELETE) or (MOD,DELETE) allocation is all that is required:
Code:

//DEL     EXEC PGM=IEFBR14
//DD1     DD DSN=HLQ.MY.GDG,DISP=(MOD,DELETE,DELETE),...
Back to top
View user's profile Send private message
anu_kannu

New User


Joined: 20 Sep 2005
Posts: 6

PostPosted: Tue Sep 20, 2005 12:09 pm
Reply with quote

Hi Kevin,

I want to make all the generations (files) empty, rather than delete.

HLQ.MY.GDG.G0001V00
HLQ.MY.GDG.G0002V00
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Tue Sep 20, 2005 12:37 pm
Reply with quote

To empty a dataset, you can use this logic:

Code:

//STEP0001 EXEC PGM=SORT                                 
//SORTIN   DD   DISP=SHR,DSN=HLQ.MY.GDG.G0001V00
//SORTOUT  DD   DISP=SHR,DSN=HLQ.MY.GDG.G0001V00
//SYSOUT   DD   SYSOUT=*                                 
//SYSIN    DD   *                                         
  OPTION COPY                                             
  OMIT COND=ALL                                           
//*


However, there is no special trick to make this work in just one step for all of the generations. This step would have to be repeated, either manually or programatically, for every generation as needed.
Back to top
View user's profile Send private message
anu_kannu

New User


Joined: 20 Sep 2005
Posts: 6

PostPosted: Tue Sep 20, 2005 1:12 pm
Reply with quote

Thanks Kevin
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts Merge GDG versions JCL & VSAM 5
No new posts How to Clear all TSQs during CICS sta... CICS 10
No new posts How to check if any of the GDG versio... JCL & VSAM 3
No new posts Related to GDG versions creations JCL & VSAM 5
Search our Forums:

Back to Top