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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.