View previous topic :: View next topic
|
Author |
Message |
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
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 |
|
|
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|