BookmarkSubscribeRSS Feed
a13
Calcite | Level 5 a13
Calcite | Level 5

code:

%LET iterations = 5;
%LET winner = Lance Armstrong;
DO i = 1 to &iterations;
TITLE "First: &winner";

 

log:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 %LET iterations = 5;
74 %LET winner = Lance Armstrong;
75 DO i = 1 to &iterations;
__
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
76 TITLE "First:" &winner;
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91
2 REPLIES 2
novinosrin
Tourmaline | Level 20

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 

ballardw
Super User

%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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 943 views
  • 0 likes
  • 3 in conversation