code:
%LET iterations = 5;
%LET winner = Lance Armstrong;
DO i = 1 to &iterations;
TITLE "First: &winner";
log:
macro loops need macro syntax
%LET iterations = 5;
%LET winner = Lance Armstrong;DO i = 1 to &iterations;TITLE "First: &winner";
something like:
%macro a13;
%DO i = 1 %to &iterations;
TITLE "First: &winner";
%end;
%mend a13;
Your code doesn't ring the bell in what you want to accomplish
%LET iterations = 5;
%LET winner = Lance Armstrong;
DO i = 1 to &iterations; <- This DO belongs in a data step block of code. You may be thinking of a macro loop which would use %DO but still has a syntax error because you show no End or %end.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.