script to delete empty, read-only tapes from volhist?

brentwg

ADSM.ORG Member
Joined
Dec 18, 2003
Messages
8
Reaction score
0
Points
0
Website
Visit site
Hi:



I was wondering if anyone (tremendously more experienced than I am) has created a script which can accomplish the following:



1) search for volumes from the volumes table where access is READONLY and status is EMPTY

2) once found, run the del vol command to delete them from volhist



I have a basic SQL statement to locate the tapes:



SELECT volume_name -

FROM volumes -

WHERE access = 'READONLY' and status = 'EMPTY'



The problem is that I have no idea if it is possible to construct some kind of loop which feeds the query's output to the del vol command.



Is this even possible?
 
I was just researching the Admin Ref Guide and I was wondering, could I not just use the update volume command to do the same thing? I think that the syntax would go something like this:



update volume * -

access=readwrite -

whereaccess = 'REAO' -

wherestatus = 'EMP'



For testing purposes, I think that I should enable Preview = 'Yes'



Could someone who's been doing this job much longer than I have, please confirm this?
 
Back
Top