Date: Fri, 23 Jul 2004 22:06:53 +1200
Reply-To: Laurie Fleming <feiraul@ESIDARAP.TEN.ZN>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Laurie Fleming <feiraul@ESIDARAP.TEN.ZN>
Organization: Messy
Subject: Re: how to delete datt sets??
In article <2d2cf67d.0407230132.6496687a@posting.google.com>,
saqi2000@totalise.co.uk (Saqi) wrote:
> Hi their,
>
> I am writing a small macro but can't think of anyway round it. I
> would like that macro to delete data sets that have RANNNN where
> nnnn=numeric four digit. There is also another data set that is
> called RASA. I want to delete RANNNN data sets but not RASA. Can
> anyone help please.
>
> Thanks in advance
>
> Saqi
As long as these are the only datasets in the library, you could do it
this way (assuming they are in a library called xyzzy)
/*
Just to make sure, take backup.
*/
proc copy in=xyzzy out=work;
select rasa;
run;
proc datasets lib=xyzzy nolist nowarn mt=data;
/*
Change rasa into a name that doesn't start with 'ra'
*/
change rasa = save_rasa;
/*
Delete all the datasets that start with 'ra'
*/
delete ra:;
/*
Change it back again.
*/
change save_rasa = rasa;
quit;