May 18, 2004 #1 cojiro MIS Mar 20, 2003 62 US I have data in the following format. -32.90 +342.20 +0.01 +1,000.32 -405.23 Does anyone know the best way to input data from this format? Thanks.
I have data in the following format. -32.90 +342.20 +0.01 +1,000.32 -405.23 Does anyone know the best way to input data from this format? Thanks.
May 18, 2004 1 #2 klaz2002 Programmer Nov 6, 2002 559 US Cojiro, While you probably can find a format that will read it in correctly, why not simply use the following solution. [ex.] I'm assuming that data is in a text file named nums.dat. filename _readin 'physical_path\nums.dat'; data nums; infile _readin; input x $; y = input(compress(x,', '),8.4); ** drop x; run; You could drop the x var if you want to. What you end up with are positive and negative numbers. I hope that this was helpful. Klaz Upvote 0 Downvote
Cojiro, While you probably can find a format that will read it in correctly, why not simply use the following solution. [ex.] I'm assuming that data is in a text file named nums.dat. filename _readin 'physical_path\nums.dat'; data nums; infile _readin; input x $; y = input(compress(x,', '),8.4); ** drop x; run; You could drop the x var if you want to. What you end up with are positive and negative numbers. I hope that this was helpful. Klaz