Chapter Contents

Previous

Next
%END

%END



Ends a %DO group

Type: Macro statement
Restriction: Allowed in macro definitions only


Syntax
Example
Ending a %DO group

Syntax

%END;


Example

Example 1: 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


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.