I am trying to convert a character variable containing a number into a numeric variable without losing decimal precision. Here is an example with output:
data _null_;
format res 20.17;
res = input("54.78566360473633",20.17);
put res;
run;
and the result:
54.78566360473630000
You can see that the number of digits in the result is correct, but the last non-zero digit does not match the final digit of the character variable. I've tried using formats with a larger and smaller number of digits (such as 18.15 or 15.13), and I've tried "forcing" the number of decimals with a format like f20.17, but none of this seems to be working.
I've tried looking through some documentation pages but nothing seems germane. I'm sure this is really basic stuff I'm missing here but, how can I get sas to faithfully read in all digits?