Hi everyone,
I'm getting crazy to find out the error. Can anybody help me??
Thanks
You have omitted the % sign: %do %until, not %do until
How about this:
proc means data=mc1.storm_final n mean max maxdec=0;
class season;
var maxwindmph minpressure;
run;
So, my solution is to not use a %DO loop or any macro language at all.
From now on, please post code as text in the box that appears when you click on the "little running man" icon and please post logs as text in the box that appears when you click on the </> icon. DO NOT POST LOGS AND CODE AS SCREEN CAPTURES.
ok about the image @PaigeMiller
using your solution, same error continues:
77 %macro storms(list);
78 %local i;
79 %let i=1;
80 %do until(%scan(&list,&i) eq );
ERROR: An unexpected semicolon occurred in the %DO statement.
ERROR: A dummy macro will be compiled.
81 %let n=%scan(&list,&i);
82 title "&n Storms";
83 proc means data=mc1.storm_final n min mean max maxdec=0;
84 class season;
85 var MaxWindMPH MinPressure;
86 where season=&n;
87 run;
88 %let i=%sysevalf(&i + 1);
89 %end;
90 %mend storms;
91
92 %storms(2011 2014)
_
180
WARNING: Apparent invocation of macro STORMS not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.
message error is about %do until loop, no about proc means.
You have completely misunderstood. My solution does not use any macro %DO loops, it does not use any macro language at all. It uses PROC MEANS with a CLASS statement, that's all you need.
I'm studying %do while/until loops, I need to use loops (your solution is valid but it not use loops)
@ppinedo wrote:
I'm studying %do while/until loops, I need to use loops (your solution is valid but it not use loops)
I would say that the idea of learning macros is good, but you also need to learn when NOT to use macros. I would never want to see someone write a macro to do that same thing as a SAS PROC.
You have omitted the % sign: %do %until, not %do until
you're right @Astounding ¡¡¡, newbie "silly" mistake 🙄
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.