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.
Senior Programmer Analyst, IM&R
Russell Investment Group
Global Leaders in Multi-Manager Investing
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, July 21, 2006 10:48 AM
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 :
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;
Macro? Array? Different string function?