BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I have  a big problem.

I am running a simple code and I get a warning.

____
1
WARNING 1-322: Assuming the symbol AND was misspelled as AND .

 

___
1
WARNING 1-322: Assuming the symbol IF was misspelled as IF .

 

What is that please???

what is wrong in my code please?

 

Data bbb;
set aaa;
IF  x1>= 6000
AND  x1<7000
AND x2>=15000
AND x3 in (2,3,4,5,6)
AND  x4>=5000
then Factor=2;
else Factor=1;
Run;

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

It is always helpful, as we have asked you many times, to post the log in the box that appears after you click on the </> icon. We want the whole log, the code, warnings, notes and errors, everything.

--
Paige Miller
PaigeMiller
Diamond | Level 26

Also please note:

 

in the portion of the log you do provide, it says "...was misspelled as AND ." There is a space after AND and before the period, as if you have placed a non-printing character into your code. How does this happen? Well, one way is if your code was pasted into SAS from a word-processor or from PowerPoint or from a PDF file. Do not do this if at all possible! There are probably other ways that this can happen.

--
Paige Miller
ballardw
Super User

Another minor thing: SAS will accept comparisons such as

 

IF  6000 <= x1 <7000

which can make code much easier to follow, not to mention that some folks have a hard time getting "AND" and "OR" requirements in the correct places in complex conditions.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1624 views
  • 8 likes
  • 3 in conversation