Download _delmac_.sas _delmac_.sasSubmit a comment

%macro _delmac_ (macronam);

  %*----------------------------------------------------------------;
  %* Author: Richard DeVenezia
  %*
  %* called from: various
  %*
  %* macronam - name of macro to delete from WORK.SASMACR;
  %*
  %* mod:
  %* 11/18/98 rad initial coding
  %*----------------------------------------------------------------;

  %if (&macronam ne ) %then %do;

    %if ( %sysfunc ( cexist ( WORK.SASMACR.&macronam..MACRO ) ) ) %then %do;

      proc catalog cat=WORK.SASMACR;
        delete &macronam / et=macro;
      quit;

    %end;
  %end;

%mend _delmac_;