SYMBOLGEN: Macro variable MBR_PED_IND resolves to N
MLOGIC(RUNNER): %IF condition &mbr_ped_ind eq Y is FALSE
SYMBOLGEN: Macro variable GDIST resolves to 319.6732
SYMBOLGEN: Macro variable DIST_LIMIT1 resolves to 10
MLOGIC(RUNNER): %IF condition &gdist le &dist_limit1 is FALSE
SYMBOLGEN: Macro variable GDIST resolves to 319.6732
SYMBOLGEN: Macro variable DIST_LIMIT2 resolves to 20
MLOGIC(RUNNER): %IF condition &gdist le &dist_limit2 is FALSE
SYMBOLGEN: Macro variable GDIST resolves to 319.6732
SYMBOLGEN: Macro variable DIST_LIMIT3 resolves to 30
MLOGIC(RUNNER): %IF condition &gdist le &dist_limit3 is FALSE
SYMBOLGEN: Macro variable MBR_PED_IND resolves to Y
MLOGIC(RUNNER): %IF condition &mbr_ped_ind eq Y is TRUE
SYMBOLGEN: Macro variable GDIST resolves to 171.732
SYMBOLGEN: Macro variable DIST_LIMIT1 resolves to 10
MLOGIC(RUNNER): %IF condition &gdist le &dist_limit1 is FALSE
SYMBOLGEN: Macro variable GDIST resolves to 171.732
SYMBOLGEN: Macro variable DIST_LIMIT2 resolves to 20
MLOGIC(RUNNER): %IF condition &gdist le &dist_limit2 is TRUE
The first block worked fined. However, in the second block especially in the colored portion, the condition evaluates to TRUE instead of FALSE. Clearly 171.20 is NOT less than 20. Can someone help with what's going on here? Thanks.
I figured it out myself. I only needed to put the condition inside the function %sysevalf. Thanks.
I figured it out myself. I only needed to put the condition inside the function %sysevalf. Thanks.
Hey Punxsutawney,
I think you can still close your question as answered, so it doesn't draw attention for others that might want to try and answer the question.
Regards,
Vasilij
Glad you figured out a solution. It happened because macro variables are always character and '20' is greater than '171'. %sysevalf (and %syseval) tells the macro processor to handle them as numeric values.
(Just thought this explanation might be useful to others.)
John
Thanks.
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.