View previous topic :: View next topic
|
Author |
Message |
tishasha
New User
Joined: 14 Jun 2007 Posts: 5 Location: Manila
|
|
|
|
Hi..
I would like to know how to delete datasets which are, for example, 5 weeks old from the current date.'
Thank you! |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
Back to top |
|
|
tishasha
New User
Joined: 14 Jun 2007 Posts: 5 Location: Manila
|
|
|
|
hi balajiofcrrcoe..
thank you for the reference.. however, how will I go about the deletion when I only want to delete datasets with name, for example, ABCD.EFGH.I.** |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Are we talking about DASD, Tape, or both types of dataset here ?
Are the DASD datasets guaranteed to be on DASD, or might they be migrated by the ILM software installed ?
Another question, What if the datasets are still being used off and on, or will this not happen. Maybe you could also build in a days since last used factor too, jst to be on the safe side.
Will you require backups to exist before deletion.
How are the candidates for deletion selected.
If ALL of the dataset names have a common factor, like HLQ= or 2LQ= then it would be very easy to ask your storage people to build an SMS MGMTCLAS to do this automatically and which will deal with both DASD and migrated datasets.
And of course, if you also have SMS managed tapes, then they get catered for in the same MGMTCLAS. |
|
Back to top |
|
|
tishasha
New User
Joined: 14 Jun 2007 Posts: 5 Location: Manila
|
|
|
|
Hi Expat..
I'll be creating datasets (on a daily basis) for a certain job whose names are dynamically created, ie., the current date will be concatenated on the last part of the ds name : ABCD.EFG.D070809
1) We'll be using just DASD datasets
2) The datasets can be browsed/used on and off
3) No backups required before deletion
4) Those datasets with ds name: ABCD.EFG.* that have been around for 5 weeks as of the current date should be deleted
Great thanks! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If they will not get migrated, then you can use DFdss
But - the easiest and surest solution would be to get your storage group to define the correct MGMTCLAS for these datasets, and then sit back and let HSM do all the work. |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
This is one of the way to resolve the requirement:-
Since the last qualifer is the file creation date,so ABCD.EFG.* will list only
one file with the name ABCD.EFG.D070709 (if we want to get the files created
before to 4 weeks from system date).
So you can code a new cobol pgm which will deduct 4 weeks from system date and
will get the newdate,you can string the strings 'DELETE' 'ABCD.EFG.D' and the
newdate like 'DELETE ABCD.EFG.D+new date' and write it to a parm file, further
you can pass this to the idcams sysin. |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
This is one of the way to resolve the requirement:-
Since the last qualifer is the file creation date,so ABCD.EFG.* will list only one file with the name ABCD.EFG.D070709 (if we want to get the files created before to 4 weeks from system date).
So you can code a new cobol pgm which will deduct 4 weeks from system date and will get the newdate,you can string the strings 'DELETE' 'ABCD.EFG.D' and the newdate like 'DELETE ABCD.EFG.D+new date' and write it to a parm file, further
you can pass this to the idcams sysin. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
balajiofcrrcoe
Why would the OP want to code a COBOL program to do what either his storage people can do in about 5 minutes, or he can do himself in about 10 minutes using Dfdss.
Dfdss has a date capability that allows you to select the current date less any given quantity, like *-35, which funnily enough equates to 5 weeks ago. |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
You are correct expat,
I said about the other way of doing it. |
|
Back to top |
|
|
|