Date: Thu, 23 Aug 2007 05:23:33 -0400
Reply-To: Arild S <sko@KLP.NO>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arild S <sko@KLP.NO>
Subject: Re: DISTINGUISH INTEGER AND DECIMAL
On Thu, 23 Aug 2007 09:00:50 -0000, cat.. <cat.b41@GMAIL.COM> wrote:
>On Aug 22, 2:55 pm, gerhard.hellrie...@T-ONLINE.DE (Gerhard
>> I don't understand that: in SAS there is only one type of numeric
>> "float binary" to say it in PL1 syntax. There are no integers in SAS. So
>> searching a dot in the values makes no sense.
>It does, run this:
> format x 8.1;
> x = 3;
> y = index(x,'.');
> put y =;
No, it doesn't. INDEX is a character function. It applies to character
variables, not numeric ones. That's why you get the message
NOTE: Numeric values have been converted to character values...
SAS converts your numeric 3 to character "3", and searches for a '.'.
The value returned is 0, as a dot is not found. Try a search for "3":
13 data _null_;
14 format x 8.1;
15 x = 3;
16 y = index(left(x),'3');
17 put y =;
you get the expected..
NOTE: Numeric values have been converted to character values ...