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 (April 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 20 Apr 2004 14:31:04 -0400
Reply-To:     Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Subject:      Re: search for a string term
Comments: To: max8ca@YAHOO.COM

On Tue, 20 Apr 2004 10:13:37 -0700, Max503 <max8ca@YAHOO.COM> wrote:

>I used index() to search for "F BUMPER". The returned results >contain strings like "OF BUMPER". How do I restrict the serach >to the exact string term I defined? Thanks. > >Max

Max,

The INDEXW function might work for you. Even though it is typically associated with looking for a WORD, the documentation is not very clear.

That said, I am not sure what is the end goal. If you are trying to identify a set pattern that has a white space before and after, this could work:

data _null_ ; input @1 mystring $char50. ; indw=indexw(mystring,"F BUMPER"); put indw= ; cards ; GET F BUMPER GET OF BUMPER WHAT IF BUMPER WHAT A F BUMPER GET F BUMPERS run ;

Kind Regards,

Venky Chakravarthy


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