Please run the below code and check for dataset have2
Why do I get value of flag as "2<1" when all values in nos2 is > nos1?
What am I missing?
Please advise.
Thanks
PROC FORMAT;
VALUE rvsd_format
5000-10000="5000-10000"
10000-25000="10000-25000"
;
run;
data have;
input nos1 nos2;
datalines ;
9544.59 10605.10
8588.00 10781.20
9029.48 11061.31
9831.00 10158.70
9454.00 13380.18
9504.00 15888.00
8400.00 12728.80
6672.00 16516.00
7595.12 14062.24
9951.13 10780.39
;
run;
data have2;
set have;
fmt_nos1=put(nos1,rvsd_format.);
fmt_nos2=put(nos2,rvsd_format.);
if fmt_nos2=fmt_nos1 then flag="Equal";
else if fmt_nos2>fmt_nos1 then flag="2>1";
else flag="2<1";
run;