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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.