Processing Statements Iteratively

Overview

Many macro applications require iterative processing. With the iterative %DO statement that you can repeatedly
  • execute macro programming code
  • generate SAS code.
General form, iterative %DO statement with %END statement:
%DO index-variable=start %TO stop <%BY increment>;
text
%END;
Here is an explanation of the syntax:
index-variable
is either the name of a macro variable or a text expression that generates a macro variable name.
start and stop
specify either integers or macro expressions that generate integers to control how many times the portion of the macro between the iterative %DO and %END statements is processed.
increment
specifies either an integer (other than ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.