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;
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.
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.
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.
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.
Ready to level-up your skills? Choose your own adventure.