Reputation: 1958
I would like to read and display numbers like below using infile
statement -
without loosing any of the digits ( significant and non significant both) from a flat file which are the best formats to use in for - input , informat and format.
EDIT:
Have tried below so far, digits getting truncated for the last one , rest two are coming fine
data _null_;
infile datalines;
format x BEST32.;
input x : BEST32.;
put x=;
datalines;
0.02133322413531
25895449673.5189
190848802804.89248974
;
run;
Output:
Upvotes: 4
Views: 4635
Reputation: 317
If you store the numbers as a character variable you will not lose any of the digits.
Every time you perform a calculation you could use the input function to convert to a numeric.
input(number_string,format.)
Also if you use Data Step 2 (DS2) then you are not limited to the two datatypes, you could also use decimal(p,q)
, where (p,q) the digits to the left and right of the decimal point, that can be up to 52.
Upvotes: 0