Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

currency format input question 1

Status
Not open for further replies.

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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top