By using the $7. format in your put statement you are corrupting your numeric values. The outout of the put statement is always character so you should be using a proper numeric format to not obscure your result (basically you are rounding the the integer level instead of the the hundreth as you want). To avoid the 'spaces' try using encasing your calculation in a strip(). data _null_; do month=1,2,3; do day=2,3,4,7,11,13,17; if mod(day,2)=0 then year=2000; else year=2001; servicedate=mdy(month,day,year); currentdate=today()-day; yrdif=strip(put(round(yrdif(servicedate,currentdate,'ACT/ACT'),.01),best.)); put yrdif=; end; end; run;
... View more