Thanks for yor reply. I am nit sure why SAS log displays the following message...
SYMBOLGEN: Macro variable MAX_V1 resolves to 49.809566165
MLOGIC(AUTO_VIF): %IF condition %sysevalf(&Max_V1) le 5 is TRUE
MLOGIC(AUTO_VIF): %GOTO LEAVE (label resolves to LEAVE).
MLOGIC(AUTO_VIF): Ending execution.
The first %DO statement shown in the original post has incorrect syntax and would generate an error. The %DO %UNTIL(...) logic inside the parentheses must be enclosed in parentheses itself and you must use %SYSEVALF() correctly.
Suggested Google advanced search argument, this topic / post:
Numeric expressions are evaluated with a %EVAL (which only works with integers). If either side of your expression resolves to a non-integer, and anything with a decimal point including 1. is a non-integer, the comparison becomes alphabetic rather than numeric. Using %SYSEVALF as Scott suggests forces a numeric comparison on non-integers.
Consider the following snippet from my LOG:
87 %macro test;
88 %let v=49.5;
89 %if &v lt 5 %then %put &v is less than 5;
90 %if &v gt .5 %then %put &v is GT than .5;
91 %if %sysevalf(&v gt 5) %then %put &v is GT than 5;
92 %mend test;
49.5 is less than 5
49.5 is GT than .5
49.5 is GT than 5
Although the second %IF appears to evaluate correctly (numerically) it is actually doing an alphabetic comparison (decimal points sort before numbers alphabetically on my OS - windows).
Only the third expression is actually giving correct numeric results.
The key is to remember that for expressions to be evaluated numerically in the macro language they must be integer or alternatively we take charge with the %SYSEVALF function.