View previous topic :: View next topic
|
Author |
Message |
BUBLOO
New User
Joined: 04 Oct 2005 Posts: 3
|
|
|
|
The requirement is to delete certain datasets ( say all datasets with <USERID.DELETE> qualifer) which are more than X days OLD ( say 30 days ) ..
In short delete the datasets with <USERID.DELETE> qualifer which are more than 30 days old using batch job..
Is there any JCL utility available for this or any other alternative .. pls let me know ..
Bubloo. |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
The answer to this seems to lie within the ADRDSSU utility. This is a powerful utility for managing storage, so be very careful when using it.
For your particular issue, this looks like it would work:
Code: |
//STEP0001 EXEC PGM=ADRDSSU,PARM='TYPRUN=NORUN'
//SYSPRINT DD SYSOUT=*
//JUNK DD DUMMY
//SYSIN DD *
DUMP DATASET(INCLUDE(HLQ.**) -
BY((CREDT,LT,*,-30))) -
OUTDD(JUNK) DELETE
/*
//
|
Run it with the 'TYPRUN=NORUN' parm enabled first to make sure that it is doing what you want. If everything looks good, then remove the parm and run it once more, and the datasets should be deleted. From what I've read in other posts concerning this utility, it will work with datasets that are on DASD, not those that are on tape or that have been archived.
I'm not a storage expert, so I'm not intimately familiar with this utility. For more information, check the manual:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2R230/CCONTENTS?DT=20040624152404 |
|
Back to top |
|
|
BUBLOO
New User
Joined: 04 Oct 2005 Posts: 3
|
|
|
|
Thanks Kevin.. Will check the utility per your advice..
Bubloo |
|
Back to top |
|
|
BUBLOO
New User
Joined: 04 Oct 2005 Posts: 3
|
|
|
|
Could any one let me know if there are any alternatives for achieving this ? |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
BUBLOO wrote: |
Could any one let me know if there are any alternatives for achieving this ? |
Yes. Execute the IDCAMS program, using the LISTCAT function to list all of the datasets cataloged for the indicated high-level qualifier:
LISTCAT LVL(HLQ) ALL
This will give you a listing of the datasets and, amongst other information, their creation date.
Run the LISTCAT output through a program/utility to extract just the dataset names and their respective creation dates.
Now, run that output through a program/utility to determine which dates are over 30 days old, and generate the appropriate IDCAMS DELETE statements for those datasets.
Execute the IDCAMS program once more, using the list of DELETE statements from the previous step. |
|
Back to top |
|
|
|