|
one more piece on information
I get the same behavior in excel
Sigurd Hermansen wrote:
> William:
> I have to wonder initially how a long integer in MS Access has a value of
> 2.6 and what the 'a.' represents in the pass-thru query ..., but neither of
> these concerns affects the numeric representation of value passed to SAS.
> Normally you would want to ROUND() the value while writing it to the table
> S. Try
>
> create table S as select round(a,.1) as a,* from connection to odbc ....
>
> if you are looking for numeric precision to one decimal place. That will
> take care of values slightly greater than the target number as well.
>
> Putting the rounded column variable 'a' first in the SELECT list replaces
> the original variable named a in the dataset S. If you refer to it in a
> WHERE statement in the same outer query, you'll have refer to it as
> 'calculated a'. It would be cleaner to write out the full list of column
> variables if not too much trouble, or use a macro to create a
> comma-delimited list of all variable names except a.
> Sig
>
> -----Original Message-----
> From: William Kossack [mailto:kossackw@NJC.ORG]
> Sent: Friday, January 16, 2004 4:12 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: proc sql retrieving long integer
>
> I'm using proc sql to retrieve a long integer from microsoft access. In
> access a number is shown as 2.6 but in sas it becomes 2.5999999046. How do I
> fix this in my sql code?
>
> proc sql;
> connect to odbc(dsn=odbc);
> create table S as select * from connection to odbc
> (select id, a. from tblF );
> disconnect from odbc;
> quit;
>
> in the example code a which should be 2.6 is 2.59999...
|