Date: Tue, 5 Sep 2006 18:46:15 -0400
Reply-To: Richard Ristow <wrristow@mindspring.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <wrristow@mindspring.com>
Subject: Re: INDEX specified character location
In-Reply-To: <6C01A852608309408AD59AFBFF5DD51A0594C747@aca_exchange.worl
datwork.org>
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 12:29 PM 9/5/2006, Brian Moore wrote:
>How do I use INDEX or some other command to test a text variable for a
>specific character at a specific location? I need first position in
>this case.
Well, from what follows I'm not sure this what you really want, but
what you say you want is very simple:
To test for 'A' in position 1 of string TEST_IT,
IF (SUBSTR(TEST_IT,1,1) EQ 'A')...
To test for 'X' in position 17,
IF (SUBSTR(TEST_IT,17,1) EQ 'X')...
>I'm trying to clean search results such that :
>
>(something) = something
>
>and
>
>something (else) = something (else)
That looks like you're trying to remove parentheses from the string
before comparing. I'm happy to give syntax for that, but I'd like to be
clearer what you want, first.
>syntax following this message would return 'omething (else)' without
>controlling INDEX to examine first characters only.
'Fraid I don't get this one. Can you give the code you have in full,
what it produces, and what you want it to produce?
Good luck,
Richard Ristow