BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Punxsutawney
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Punxsutawney
Calcite | Level 5

I figured it out myself. I only needed to put the condition inside the function %sysevalf. Thanks.

View solution in original post

4 REPLIES 4
Punxsutawney
Calcite | Level 5

I figured it out myself. I only needed to put the condition inside the function %sysevalf. Thanks.

VasilijNevlev
Quartz | Level 8

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

=======================================
For more information about {An}alytium, visit https://www.analytium.co.uk
bentleyj1
Quartz | Level 8

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

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1240 views
  • 0 likes
  • 3 in conversation