> From: SAS Techies > Subject: SAS Macro to delete a SAS dataset > > 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 @ you're working too hard, and providing slow code proc delete is faster than either proc datasets or sql drop table: http://www.sascommunity.org/wiki/PROC_Delete Ron Fehd the module/routine/subroutine maven CDC Atlanta GA USA RJF2 at cdc dot gov