well, this one reminds me another thread recently discussed: http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0911c&L=sas-l&F=&S=&P=4034 On Wed, 2 Dec 2009 08:50:34 -0800, SAS Techies <sastechiesblog@GMAIL.COM> wrote: >Here?s a simple SAS Macro to delete a SAS dataset?It takes the name of >the SAS dataset as the parameter? > >%macro deletedsn(dsname); > >%if %index(&dsname,'.') eq 0 %then %do; %let lib=work; %let >dsn=&dsname; %end; >%else %if %index(&dsname,'.') eq 0 %then %do; %let lib=%scan(&dsname, >1,'.'); %let dsn=%scan(&dsname,1,'.'); %end; > >proc datasets lib=&lib nolist; > delete &dsn; >quit; >%mend deletedsn; > >%deletedsn(new); >%deletedsn(somelib.new); > >Read more @ http://sastechies.blogspot.com/2009/12/sas-macro-to-delete-sas- dataset.html