%END Statement

Ends a %DO group.
Type: Macro statement
Restriction: Allowed in macro definitions only

Syntax

%END;

Example: Ending a %DO Group

This macro definition contains a %DO %WHILE loop that ends, as required, with a %END statement:
%macro test(finish);
   %let i=1;
   %do %while (&i<&finish);
      %put the value of i is &i;
      %let i=%eval(&i+1);
   %end;
%mend test;
%test(5)
Invoking the TEST macro with 5 as the value of finish writes these lines to the SAS log:
The value of i is 1
The value of i is 2
The value of i is 3
The value of i is 4