BookmarkSubscribeRSS Feed
Kwok
Calcite | Level 5
Hi,

Do you know what is the SAS function or routine that can convert a string such as
7.8E+5 or 000078E-5 into the correct numeric values with decimal places? I tried the EXP function but the base values already defined e.

Thanks
Kwok
5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12
Checkout the "E" informat.
deleted_user
Not applicable
Hi,Kwok
Here is the codes:
data _null_;
p='7.8E+5';
o=input(p,12.2);
put p o;
run;
Kwok
Calcite | Level 5
Thanks for your code. But how do you determine the 12.2 ? If the data stream variable E formay such as 7.8E+5, 7.8E-7, 8.1005E+13 ..., how would you define the informat value ?

Thanks
Tim_SAS
Barite | Level 11
Generally you don't have to. If the data contain decimal points the decimal value is ignored. Here's the doc: http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000204411.htm.
Kwok
Calcite | Level 5
Thanks Tim,

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2181 views
  • 0 likes
  • 4 in conversation