Did you get errors from the INPUT() function for the lines that generated missing values?
Either your values are right aligned so that the first 5 characters do not have any value or they have some "invisible" characters that are causing the text to not look like numbers.
First, use 32. or even better COMMA32. as your INFORMAT. (Note BEST is a FORMAT and not an INFORMAT).
Second remove the spaces and/or non digits from the string.
data want ;
infile cards truncover ;
input str $char50. ;
if _n_=1 then str='A0'x||str;
if _n_=2 then str=strip(str)||'0D'x;
num1 = input(str,??5.);
num2 = input(compress(str,'($,ED.)','kd'),??comma32.);
put num1= best9. @15 num2=best9. @30 str=:$quote.;
cards;
3456
4567
456.123
5677
1.234E3
(123,345)
;
num1=. num2=3456 str=" 3456"
num1=. num2=4567 str="4567
"
num1=456.1 num2=456.123 str="456.123"
num1=. num2=5677 str=" 5677"
num1=1.234 num2=1234 str="1.234E3"
num1=. num2=-123345 str="(123,345)"
... View more