BookmarkSubscribeRSS Feed
liudw925
Calcite | Level 5

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.

3 REPLIES 3
Alpay
Fluorite | Level 6

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?

liudw925
Calcite | Level 5

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.

liudw925
Calcite | Level 5

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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1401 views
  • 3 likes
  • 2 in conversation