While on the topic, and unrelated to the comma informat, but related to the subject:
1- best. in not an official informat
2- best. is not even the best informat for reading numbers.
3- 32. is the best informat for reading numbers
4- 32. still generates erroneous readings for large numbers as only part of the number is read
5- Letting sas do the conversion by adding +0 to a string as above is the only fool-proof solution, but generates the infamous message [pre] NOTE: Character values have been converted to numeric values at the places given by:[/pre]6- I reckon sas should provide a to_number() function so all normal (no comma etc) numbers can safely be read with no noxious log message.
Code:
[pre]
data _null_;
format Y best32.;
input X $40. COMMENT $40.; put COMMENT;
Y=X+0; put '0 ' X= Y=;
Y=input(X,?? best32.); put '1 ' X= Y=;
Y=input(X,?? 32. ); put '2 ' X= Y=;
cards;
1234567890123456789012345678901234567890 columns (integer >32)
123456798012345678901234567980 integer ≤32
1234567980123456789.1234567890123456789 integer part ≤32
1234567980123456789012345679801234567.8 integer part >32
0.0000000000000000001234567890123456789 small decimal
0.0000000000000000000000000000000000012 very small decimal
1234567980123456789012345678e10 positive scientific
12345679801234567890123456789012e10 positive scientific length>32
1234567980123456789012345678e-10 negative scientific
1234567980123456789012345678901e-10 negative scientific length>32
run;
[/pre]
Result:
[pre]
columns (integer >32)
0 X=1234567890123456789012345678901234567890 Y=1.2345678901234E39 => correct
1 X=1234567890123456789012345678901234567890 Y=12345678901234566802609541218304 => incorrect
2 X=1234567890123456789012345678901234567890 Y=12345678901234566802609541218304 => incorrect
integer ≤32
0 X=123456798012345678901234567980 Y=123456798012345682323755237376 => correct
1 X=123456798012345678901234567980 Y=123456798012345682323755237376 => correct
2 X=123456798012345678901234567980 Y=123456798012345682323755237376 => correct
integer part ≤32
0 X=1234567980123456789.1234567890123456789 Y=1234567980123456768 => correct
1 X=1234567980123456789.1234567890123456789 Y=1234567980123456768 => correct
2 X=1234567980123456789.1234567890123456789 Y=1234567980123456768 => correct
integer part >32
0 X=1234567980123456789012345679801234567.8 Y=1.2345679801234E36 => correct
1 X=1234567980123456789012345679801234567.8 Y=12345679801234567106475616894976 => incorrect
2 X=1234567980123456789012345679801234567.8 Y=12345679801234567106475616894976 => incorrect
small decimal
0 X=0.0000000000000000001234567890123456789 Y=1.2345678901234E-19 => more precision
1 X=0.0000000000000000001234567890123456789 Y=1.23456789012E-19 => less precision
2 X=0.0000000000000000001234567890123456789 Y=1.23456789012E-19 => less precision
very small decimal
0 X=0.0000000000000000000000000000000000012 Y=1.2E-36 => correct
1 X=0.0000000000000000000000000000000000012 Y=0 => incorrect
2 X=0.0000000000000000000000000000000000012 Y=0 => incorrect
positive scientific
0 X=1234567980123456789012345678e10 Y=1.2345679801234E37 => correct
1 X=1234567980123456789012345678e10 Y=1.2345679801234E37 => correct
2 X=1234567980123456789012345678e10 Y=1.2345679801234E37 => correct
positive scientific length>32
0 X=12345679801234567890123456789012e10 Y=1.2345679801234E41 => correct
1 X=12345679801234567890123456789012e10 Y=12345679801234567106475616894976 => incorrect
2 X=12345679801234567890123456789012e10 Y=12345679801234567106475616894976 => incorrect
negative scientific
0 X=1234567980123456789012345678e-10 Y=123456798012345680 => correct
1 X=1234567980123456789012345678e-10 Y=123456798012345680 => correct
2 X=1234567980123456789012345678e-10 Y=123456798012345680 => correct
negative scientific length>32
0 X=1234567980123456789012345678901e-10 Y=123456798012345679872 => correct
1 X=1234567980123456789012345678901e-10 Y=. => incorrect
2 X=1234567980123456789012345678901e-10 Y=. => incorrect
[/pre]