|
Yes, I agree, ROUND would actually be much more precise than the Format
statement,
but I don't know what level the user is at as I think the user would have
mentioned the
format statement not be appropriate in the question if he or she had tried
that. Of
course, it is very hard to estimate the level of knowledge and desire for
preciseness
of the user, or whether the "other software" referred to is Excel or
something more complex.
-Mary
----- Original Message -----
From: "Mike Zdeb" <msz03@ALBANY.EDU>
To: <SAS-L@LISTSERV.UGA.EDU>
Sent: Tuesday, March 24, 2009 1:58 PM
Subject: Re: reducing the length of numeric variable
> hi ... OK, let's beat this to death since I'm curious
>
> given that the problem was ...
>
> ****************************************************
> My cov_4 variable looks like: cov_4 2.3164977635316 3.1546584777797
> 4.4646674776444 5.1646466797979
> I want it to look like: cov4 2.316 3.154 4.464 5.164
> I want to do this because I want to use the output file by some other
> software.
> ****************************************************
>
> I was wondering how the suggestion to use a format ("see the format
> statement.")
> would work given that numbers are not ROUNDED
> (for example, 3.1546584777797 is supposed to end up as 3.154)
>
> I thought one would have to use a FLOOR or INT function to actually change
> the value of the variable
> prior to writing to a file given that any W.D format would ROUND the value
> and there's no numeric format
> I know of that truncates decimal places (though I'd be happy to be wrong
> about that)
>
> as I said, just cirious
>
> --
> Mike Zdeb
> U@Albany School of Public Health
> One University Place
> Rensselaer, New York 12144-3456
> P/518-402-6479 F/630-604-1475
|