Download delete.sas delete.sasSubmit a comment

%macro delete (DS);

  %if %sysfunc (exist (&DS)) %then %do;

    proc sql noprint;
      drop table &DS;
    quit;

  %end;
  %else
  %if %sysfunc (exist (&DS, VIEW)) %then %do;

    proc sql noprint;
      drop view &DS;
    quit;

  %end;

%mend delete;