LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Stefan Pohl <stefan.pohl@ISH.DE>
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


Back to: Top of message | Previous page | Main SAS-L page