• SAS Macro to delete a SAS dataset

    Posted on June 28, 2012 by in Macros, SAS

    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,.) gt 0  %then %do; %let lib=%scan(&dsname,1,.); %let dsn=%scan(&dsname,2,.); %end;
    proc datasets lib=&lib nolist;
     delete &dsn;
    %mend deletedsn;
    Be Sociable, Share!

    Written by

    View all articles by

    Email : [email protected]

    Leave a Reply