BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

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.

 

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
  • 2388 views
  • 8 likes
  • 3 in conversation