data _null_;
n=3;
do i=1 to 5;
if i<n then
do;
continue;
end;
else
do;
leave;
end;
end;
put i=;
run;
The sas log:
9 quit;
10 data _null_;
11 n=3;
12 do i=1 to 5;
13 if i<n then
14 do;
15 continue;
16 end;
17 els??? ???? do;
--- -
1 180
WARNING 1-322: Assuming the symbol ELSE was misspelled as els.
ERROR 180-322: Statement is not valid or it is used out of proper order.
I am not seeing any errors when the above code was submitted.
If I replace 'else' with 'els' and submit I get the WARNING but not the ERROR.
What version of SAS and environment are you using?
Thank you for your help.
My SAS is version 9.2, and i used enhanced editor and submitted. But i always got ERROR , there were some question marks in the log. Very strange! I don't know why. I tried to install SAS again and the problem was still not resolved.
By the way, all other programs run correctly on the SAS.
I have solved this problem.
It is the SAS problem, perhaps a bug in my download SAS 9.2.
I installed SAS9.3, and then everything is OK.
Thank you anyway.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.