The SAS numeric variable you assigned is associated with a FORMAT, as you coded, so the PROC PRINT is using that format which is different than what SAS has stored internally. Either remove the SAS FORMAT statement or use another (more revealing) output format such as BEST. in your code.
The SAS DOC has topic discussion about SAS numeric variable precision and storage.
nah -- didn't work. it only works if I change the informat from '8.2' to 'best.'. I want to know why informat 8.2 does not work. this is not about precision, this is about how informat works. thanks!
The problem seems to be with your input(d1, 8.2) statement. You are telling SAS to read 2 decimal places. Use a best. here and SAS will respect your decimal placement.
so d2 = input(d1, best.);
w.d
Syntax Description
w
specifies the width of the input field.
Range: 1-32
d
optionally specifies the power of 10 by which to divide the value. If the data contain decimal points, the d value is ignored.
when your text contains the decimal point never tell a numeric informat how many decimals are present. That feature is needed only where the text has no decimal point.
Use informat 8. or percent8.