View previous topic :: View next topic
|
Author |
Message |
Naresh chinthaneppu
New User
Joined: 21 Jun 2007 Posts: 11 Location: pune
|
|
|
|
Hi,
i want to delete all the datasets starting with some string CHIRU.there are 1500 datasets starting with CHIRU.i can not do it manually typing D against each dataset.
similerway i want to delete all datasets of the format NAGA*.AB001234.* |
|
Back to top |
|
|
jobin
New User
Joined: 20 Feb 2007 Posts: 9 Location: Bangalore
|
|
|
|
List all the datasets starting with CHIRU using
"LISTC LEVEL('CHIRU')" into an array.
Regarding the getting specific pattern do a sort on the list. Have a look at <a href="http://ibmmainframes.com/viewtopic.php?t=611&highlight=list+datasets+starting">this post </a>
Loop through the array and perform "TSO" "DLETE '"FILE_NAME"'" for each datasets. |
|
Back to top |
|
|
Maverick34
New User
Joined: 19 Aug 2007 Posts: 4 Location: UK
|
|
|
|
why not use DF/dss to do this? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Unfortunately Dfdss does not cater for tape or migrated datasets |
|
Back to top |
|
|
jobin
New User
Joined: 20 Feb 2007 Posts: 9 Location: Bangalore
|
|
|
|
Try this following one
Code: |
/* rexx */
/* list all the datasets starting with nbdlzsa in filel. array */
j = 0
k = 0
x = outtrap(mbrs.)
"LISTC LEVEL('NBDLZSA')"
do i = 1 to mbrs.0
if pos('IN-CAT',mbrs.i) > 0 then nop
else do
parse var mbrs.i . '-------' mbrs.i
mbrs.i = strip(mbrs.i)
j = j + 1
filel.j = mbrs.i
end
end
/* say you want to have only datasets nbdlzsa.*.AR.* to be deleted */
do i = 1 to j
parse var filel.i . '.' . 'AR.' rest
if rest <> '' then do
k = k + 1
finall.k = filel.i
end
end
/* delete the files listed in finall. array */
do i = 1 to k
"delete '"finall.i"'"
end
exit |
Hope it helps |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Just use the TSO command DEL to delete the datasets. It works fine in my shop.
TSO DEL 'HLQ.ARU.DATAST.*' |
|
Back to top |
|
|
|