DATA Step, Macro, Functions and more

import numeric values with E

Reply
Frequent Contributor
Frequent Contributor
Posts: 101

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

Regular Contributor
Posts: 240

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: 101

Re: import numeric values with E

but the values are imported as

1000
1000
1000
1000
1000

from the text file
Super User
Posts: 9,671

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: 101

Re: import numeric values with E

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

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
  • 285 views
  • 0 likes
  • 4 in conversation