%MEND Statement

Ends a macro definition.
Type: Macro statement
Restriction: Allowed in macro definitions only

Syntax

%MEND <macro-name> ;

Required Argument

macro-name
names the macro as it ends a macro definition. Repeating the name of the macro is optional, but it is useful for clarity. If you specify macro-name, the name in the %MEND statement should match the name in the %MACRO statement; otherwise, SAS issues a warning message.

Example: Ending a Macro Definition

%macro disc(dsn);
   data &dsn;
      set perm.dataset;
      where month="&dsn";
   run;
%mend disc;