Date: Wed, 15 Feb 2006 11:38:15 -0600
Reply-To: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Subject: Re: Mantissa function
Content-Type: text/plain; charset=US-ASCII
Modify the following code for your need. Mantissa of the variable a is
shown in log window. In this case, the value 10000 will show mantissa
of 1. If you want to have mantissa 0.1 then substitute ceil(log10(a))
with (floor(log10(a))+1);
data _null_;
a=123456;
mantissa=a/10**ceil(log10(a));
put mantissa=;
run;
J S Huang
1-515-557-3987
fax 1-515-557-2422
>>> "von-hippel.1@osu.edu" <von-hippel.1@OSU.EDU> 2/15/2006 11:15:09 AM
>>>
Does anyone know of a simple function to extract the mantissa from a
SAS numeric variable?
e.g., .9978 9.978 99.978 would all be converted to .9978.
Thanks!
|