Is it possible to create a macro variable this way
%LET i= 40 LT Score LE 60;
So that if I have a data set have
Data have;
INPUT SN Score;
DATALINES;
1 25
2 30
3 80
4 76
5 35
6 50
7 40
8 35
;
And Want,
DATA Want;
SET Have;
Where &I;
RUN;
I made some silly attempts, does not seem to work.
Any help would be highly appreciated!
This error is usually generated when you forget the semicolon on the end of a macro statement.
Close your session and start afresh.
BTW a closer look at your code would lead me to retract my previous "guess".
It should work in a new session.
Richard
Show us the error messages you are getting.
At a guess, it might work with %LET SN = etc etc ;
Richard
This is the error
ERROR: Open code statement recursion detected.
This error is usually generated when you forget the semicolon on the end of a macro statement.
Close your session and start afresh.
BTW a closer look at your code would lead me to retract my previous "guess".
It should work in a new session.
Richard
Thanks Richard!
Silly me!!!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.