Thanks Ksharp.
This actually is helping me with the same kind of issue. Saved me tons of research time!
Chris
Aside from the problem of evaluating non integers with the implied %EVAL. The macro language does not evaluate compound expressions in the same way as in the DATA step.
In the DATA step
if 5 < x < 10 is evaluaged as if 5 < x and x < 10
In the macro language
%if 5 < &x < 10 is evaluated as %if (5 < &x) < 10
Regardless of the value of &X this expression is true as both 0 and 1 are less than 10.
In the macro language always break up compound expressions.
%if 5 < &x and &x < 10 %then ....
ArtC,
Love your book on SAS Macro. Wondering how I can get your signature.:smileysilly:
Best Regards,
Haikuo
It is always fun to meet those that read and use the SAS Press books. If you are at SAS Global Forum or PharmaSUG this spring look me up. I would be very happy to meet and talk with you and to of course sign your book.
Haikuo: While I haven't written any books that I can sign, look me up, too, if you are going to SGF. I'm doing one presentation with FriedEgg, another with both FriedEgg and KSharp (and a couple of other presentations too) and, of course, ArtC and I will both be presenting at the SAS-L/ SAS Discussion Forums/ sasCommunity.org/ SASProfessionals.net/ SASCanadaCommunity meetup on Tuesday night (April 24th) between 6pm and 8pm.
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.