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

Deleting datasets with respect to its creation date


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

New User


Joined: 14 Jun 2007
Posts: 5
Location: Manila

PostPosted: Wed Aug 08, 2007 8:07 am
Reply with quote

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
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Wed Aug 08, 2007 10:57 am
Reply with quote

please check the old post

ibmmainframes.com/post-21905.html
Back to top
View user's profile Send private message
tishasha

New User


Joined: 14 Jun 2007
Posts: 5
Location: Manila

PostPosted: Wed Aug 08, 2007 12:11 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 08, 2007 3:35 pm
Reply with quote

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
View user's profile Send private message
tishasha

New User


Joined: 14 Jun 2007
Posts: 5
Location: Manila

PostPosted: Thu Aug 09, 2007 1:46 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 09, 2007 2:00 pm
Reply with quote

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
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Thu Aug 09, 2007 6:03 pm
Reply with quote

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
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Thu Aug 09, 2007 6:06 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 09, 2007 9:49 pm
Reply with quote

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
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Fri Aug 10, 2007 12:00 pm
Reply with quote

You are correct expat,

I said about the other way of doing it.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Deleting a Tape file JCL & VSAM 14
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top