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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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