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 (July 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 21 Jul 2006 11:09:32 -0700
Reply-To:   "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Terjeson, Mark (IM&R)" <Mterjeson@RUSSELL.COM>
Subject:   Re: Decimal point formatting in string (novice question)
Comments:   To: dlsac <dwlafferty@GMAIL.COM>
In-Reply-To:   A<1153504072.084519.120530@b28g2000cwb.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

Hi,

You mention you have converted to string... What was the original variable type (numeric or character)?

If they were already numeric, there is no such thing as only one digit, relating to the contents of the number. But when it gets displayed, whatever format is being used may affect how many digits get displayed.

If you are converting to character, what format are you using?

If the character format is nnnn.2 or more decimal places then all of the values displayed should have two decimals. If you used BEST. or some other format that provides varying number of decimals then you could have .5 or .50 or ???, depending on what format is being used, but in the contents underneath the .5 and .50 are exactly the same!

So could you explain a bit more the purpose of distinguishing how many digits and why, and also what variable types you start out with originally (maybe a few lines of sample values).

Hope this is helpful.

Mark Terjeson Senior Programmer Analyst, IM&R Russell Investment Group

Russell Global Leaders in Multi-Manager Investing

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of dlsac Sent: Friday, July 21, 2006 10:48 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Decimal point formatting in string (novice question)

I am trying to identify records in a variable consisting of only one digit after the decimal point (due to sas formatting). For example: I'm looking for .5 not .50. I've converted the field to a string but don't know a better way to find them then than using :

data table; set table; if index (field1, '.00') then delete; if index (field1, '.01') then delete; if index (field1, '.02') then delete; ....... if index (field1, '.97') then delete; if index (field1, '.98') then delete; if index (field1, '.99') then delete; run;

Macro? Array? Different string function?

thanks.


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