SAS Techies
2009-12-02 16:50:34 UTC
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
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