- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 04-21-2010 08:44 AM
(1807 views)
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Checkout the "E" informat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Kwok
Here is the codes:
data _null_;
p='7.8E+5';
o=input(p,12.2);
put p o;
run;
Here is the codes:
data _null_;
p='7.8E+5';
o=input(p,12.2);
put p o;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tim,