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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.