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

How to delete selective versions from one GDG


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

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Wed Dec 02, 2009 10:57 pm
Reply with quote

Hi,
I want a JCL code which can delete selective number of versions from one GDG.. Let me give you the details below

1. I need to delete around 150,000 versions of one GDG. Now the condition is all the GDG versions more than 45 days old should be deleted by the JCL.

For example: I have SUBRATA.FORMJ167.CF1#MSG GDG base. Now the versions created from this base looks like below

SUBRATA.FORMJ167.SUB#MSG.D010502.T140129 - Here in D010502,
d = date, 01 = 2001, 05 = May, 02 = 2nd day of the month.

Now I need to write a job which will check this 4th qualifier (D010502) of the versions and will delete till D091018 (d = date, 09 = 2009, 10 = Oct, 18 = 18th day of the month.

So in a very simple term I need a JCL which will check above condition and will delete certain number of versions.

I have JCL which use IEFBR14 utility to delete all the version (below)

//*------------------------------------------------------
//*--DELETE GDG BASE AND OLD GENERATION --------------
//*------------------------------------------------------
//DELET01 EXEC PGM=IEFBR14
//DD01 DD DSN=SUBRATA.LOCAL.ERR2001.G0001V00,
// DISP=(MOD,DELETE,DELETE),SPACE=(TRK,0)

But I am not getting how shall implement the above logic and get it done..

I will appreciate if anyone can give me Idea on how shall I go about it..

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 02, 2009 11:01 pm
Reply with quote

SUBRATA.FORMJ167.SUB#MSG.D010502.T140129

the dataset name does not follow the rules of a gdg
so You are on Your own...

run a listcat, perform the proper date computations on the dxxxxxx part
and proceed accordingly
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Wed Dec 02, 2009 11:20 pm
Reply with quote

Hi Enrico,

Thanks for the reply.. Let me try the way you have advised.. I will let you know if it works..
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Wed Dec 02, 2009 11:26 pm
Reply with quote

Hi enrico.. by any chance.. do you have any sample JCL (the solution you have provided) which I can have a look and proceed the way you have advised me?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Dec 02, 2009 11:36 pm
Reply with quote

Hi,
Since your requirement is based on the GDG name as date rather than the actual creation date itself,
You can try using IDCAMS thing,

Using IDCAMS will reduce the number SYSIN cards to be generated in the program when compared to IEFBR14.

As Enrico said perform a Listcat find the oldest member to be deleted.

Generate the gdg names starting from the oldest member to be deleted using REXX & pass it as sysin card to the IDCAMS step.

example, generate
Code:
        Delete ('SUBRATA.FORMJ167.SUB#MSG.D010502.T140129')
        Delete ('SUBRATA.FORMJ167.SUB#MSG.D010501.T140129')
.
.
.



I give it a try when I get to office tomorrow.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 02, 2009 11:44 pm
Reply with quote

1. Terminology note: go back to the manuals and read them until you understand the difference between a version of a GDG and a generation of a GDG. Both version and generation are valid, though very different, components of a GDG. There can only be one version for a generation cataloged at a time, but up to 255 generations.

2. You cannot have more than 255 versions of a GDG cataloged, so what you said here is utter garbage:
Quote:
I need to delete around 150,000 versions of one GDG
because (1) you don't have more than 255 generations at a time for one GDG, and (2) you cannot have more than 1 version at a time for a generation.

3. SUBRATA.FORMJ167.SUB#MSG.D010502.T140129 looks more like a temporary data set name, although it could be something created by an application.

4. This is a HELP forum, not a WRITE-THE-JCL-FOR-YOU forum. Once you've coded up something and have trouble getting it to work, post your JCL and ask questions. But don't ask to be given JCL or code -- unless you're willing to pay the daily rate for professional assistance.
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
No new posts volume mass delete RMM JCL & VSAM 2
Search our Forums:

Back to Top