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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 3 replies
  • 688 views
  • 3 likes
  • 2 in conversation