Please try the below code where I used the invalue for creating the informat as 1 and 2 and now you will get the expected result in the flag variable.
PROC FORMAT;
inVALUE rvsd_format
5000-10000=1
10000-25000=2
;
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=input(nos1,rvsd_format.);
fmt_nos2=input(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;
... View more