DATA Step, Macro, Functions and more

import numeric values with E

Reply
Frequent Contributor
Frequent Contributor
Posts: 103

import numeric values with E

[ Edited ]

Have:

 

1.01E+03
1.01E+03
1.01E+03
1.02E+03
1.02E+03
 

want:

 

1001

1001

1001

1002

1002

 

but the values are imported as

 

1000

1000

1000

1000

1000

Any help to import these values correctly from txt file into SAS?

Thanks

Super Contributor
Posts: 266

Re: import numeric values with E

data t;
input k;
datalines;
1.01E+03
1.01E+03
1.01E+03
1.02E+03
1.02E+03
;;

 

Value would come as

1010

1010

1010

1020

1020

Frequent Contributor
Frequent Contributor
Posts: 103

Re: import numeric values with E

but the values are imported as

1000
1000
1000
1000
1000

from the text file
Super User
Posts: 10,035

Re: import numeric values with E

Try Ew.d informat .

 

 

data t;
input k e20.;
datalines;
1.01E+03
1.01E+03
1.01E+03
1.02E+03
1.02E+03
;
run;
proc print;run;

Frequent Contributor
Frequent Contributor
Posts: 103

Re: import numeric values with E

This works. Thanks Xia
Respected Advisor
Posts: 4,925

Re: import numeric values with E

Please tell us how you imported the data into a SAS dataset.

PG
Ask a Question
Discussion stats
  • 5 replies
  • 303 views
  • 0 likes
  • 4 in conversation