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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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