Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to delete selective versions from one GDG

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
subratarec

New User


Joined: 22 Dec 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Dec 02, 2009 10:57 pm    Post subject: How to delete selective versions from one GDG
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Dec 02, 2009 11:01 pm    Post subject: Reply to: How to delete selective number of versions from on
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

New User


Joined: 22 Dec 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Dec 02, 2009 11:20 pm    Post subject:
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

New User


Joined: 22 Dec 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Dec 02, 2009 11:26 pm    Post subject:
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: 1458
Location: Azeroth

PostPosted: Wed Dec 02, 2009 11:36 pm    Post subject:
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: 7933
Location: Bellevue, IA

PostPosted: Wed Dec 02, 2009 11:44 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Delete record or Reset RC code using ... mpawan Compuware & Other Tools 4 Tue Jul 26, 2016 3:52 pm
No new posts Delete VSAM File Records amitc23 CICS 6 Sun Apr 10, 2016 10:10 am
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us