Date: Mon, 26 Oct 2009 09:16:54 -0400
Reply-To: Michael Raithel <michaelraithel@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <michaelraithel@WESTAT.COM>
Subject: Re: Delete All except One.
Content-Type: text/plain; charset="us-ascii"
Ash007 posted the following:
> Is it possible to delete all the datasets of the Work except a dataset
> (DST01) please.
Ash, hey man; you've gotta read the 'L as well as post to it! <VBG!> Why just two weeks ago I posted the following under my "Chance to Make SAS-L History: Did You Know That..." series:
...you can delete all SAS files in a given SAS data library _EXCEPT_ those that you specifically list in the SAVE statement in PROC DATASETS? Think of PROC DATASETS' SAVE statement as a kind of KEEP statement for SAS files, instead of for SAS variables. So, the following:
proc datasets library=raithlib;
save FaveCDList FaveMovielist;
...would delete the dozen or so SAS data sets, catalogs, etc. that I have in my RAITHLIB SAS data library, leaving my two favorite SAS data sets FaveCDList and FaveMovieList alone to face the world.
So, if you were paying attention, you would already know this!
Simply cut-n-paste the above example into your code, change library=raithlib to library=WORK, change the SAVE statement to DST01, and go for broke!
Okay, and for those who just don't get it; for those who just need to have it put in plain English; for those who simply can't read between the lines: <VBG>! Got that?
Ash007, best of luck in all of your SAS endeavors!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.
Michael A. Raithel
"The man who wrote the book on performance"
Author: Tuning SAS Applications in the MVS Environment
Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition
Author: The Complete Guide to SAS Indexes
Your assumptions are your windows on the world. Scrub them
off every once in a while, or the light won't come in. - Alan Alda