SAS help里的sample:
Comparing Floating Point or Missing Values
You must use the %SYSEVALF function to evaluate logical expressions containing floating point or missing values. To illustrate comparisons with floating point and missing values, consider the following macro that compares parameters passed to it with the %SYSEVALF function and places the result in the log:
%macro compflt(first,second);
%if %sysevalf(&first>&second) %then %put &first is greater than &second;
%else %if %sysevalf(&first=&second) %then %put &first equals &second;
%else %put %sysevalf(&first is less than &second);
%mend compflt;
Invoking the COMPFLT macro with these values
%compflt (1.2,.9)
%compflt (-.1,.)
%compflt (0,.)
places these values in the log:
1.2 is greater than .9
-.1 is greater than .
0 is greater than .
|