| Date: | Thu, 20 May 2004 12:42:57 -0400 |
| Reply-To: | Howard Schreier <Howard_Schreier@ITA.DOC.GOV> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Howard Schreier <Howard_Schreier@ITA.DOC.GOV> |
| Subject: | Re: Scientific notation |
|---|
Correction:
An informat like 10.7 should scale values when it processes a character
string lacking an explicit decimal point, regardless of whether scientific
notation is used. In Kevin's example, that happened to correspond to the
non-use of scientific notation.
On Mon, 17 May 2004 16:37:16 -0400, Howard Schreier
<Howard_Schreier@ITA.DOC.GOV> wrote:
>This problem got a good workover while I made my post-SUGI visit to Quebec
>City. So I will comment only on the choice of informat.
>
>I don't think anyone suggested the simplest and most correct informat,
>which is simply
>
> 10.
>
>Various people suggested 10.7, E10., and BEST10. (or minor variations).
>
>10.7 is simply wrong; it scales the values not expressed in scientific
>notation.
>
>E10. works alright in this case. The documentation suggests otherwise: "The
>Ew.d informat is not used extensively because the SAS informat for standard
>numeric data, the w.d informat, can read numbers in scientific notation.
>Use Ew.d to permit only scientific notation in your input data." So one
>might expect missing values for the USA and TURKEY observations. However,
>they were converted as needed. I conclude that Ew.d informats are
>equivalent to their w.d counterparts.
>
>BESTw. is not documented as an informat, but is apparently accepted as
>another synonym for W. After all, the "best" concept does not apply to
>character-to-numeric conversion, and if it did apply, it would be circular
>(you would need to know the numeric magnitude in order to pick the informat
>used to extract the number).
>
>On Thu, 13 May 2004 11:42:10 -0400, CHRISTENSEN,KEVIN W <chriske2@UFL.EDU>
>wrote:
>
>>I have a SAS dataset that looks like the following:
>>
>>COUNTRY POPULATION
>>USA 1000000
>>CHINA 1.0016E+07
>>JAPAN 2.0616E+07
>>TURKEY 2351522
>>
>>The population variable is read in as a character and I'd like to
>>read it as a number. Unfortunately the scientific notation in
>>some observations will make it difficult (I think). Any ideas
>>around this?
>>--
>>CHRISTENSEN,KEVIN W
|