Date: Thu, 21 Feb 2008 12:36:36 -0500
Reply-To: Dave Scocca <dave@SCOCCA.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave Scocca <dave@SCOCCA.ORG>
Subject: Re: count the digits of numbers
In-Reply-To: <F06E7847CB9C40E6A334E70E5A9B4570@aktuare.local>
Content-Type: text/plain; charset=us-ascii; format=flowed
--On 2/21/2008 6:31 PM +0100 Stefan Pohl wrote:
> I want to count the digits of numbers in SAS,
> for ex.: 1029 has 4 digits.
>
> Is there a function in SAS to do this?
I suspect taking INT() of LOG10() and adding one should do the trick.
e.g.,
digits = int(log10(x))+1 ;
Dave
|