data AGE;
set B;
where AGE =>65 OR AGE<12;
run;
I want to have a dataset with records that have AGE=>65 or AGE<12, but the above code doesn't work.
I get this in the log:
| _ | |
| 22 | |
| 76 |
ERROR: Syntax error while parsing WHERE clause.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
| a missing value, INPUT, PUT. |
ERROR 76-322: Syntax error, statement will be ignored.
You need >= or (and I never say always but) I always use mnemonics GE.
To avoid confusion with those symbols, I always use GE for >= (Greater than or Equal to) and LT for < (Less Than).
Thanks!
Thanks for all the helpful comments.
But now I notice that I have some records with Age=.
So now I want age that are also 0=<AGE<12.
Thanks
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.