%MEND Statement

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


%MEND <macro-name> ;

Required Argument

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";
%mend disc;