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 (March 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 19 Mar 2010 17:15:54 -0400
Reply-To:     Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject:      Re: Index question
Comments: To: saigovind chenna <saigovind.chenna@GMAIL.COM>
In-Reply-To:  <b3a8c8341003190607l3c77e809q441c987674436ecc@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"

Saigovind: You can search for a single value of medc in a list of terms: data test; input medc: $10. ; if index('LOXITANE LOXAPINE LUDIOMIL',strip(medc)) then put "Yes"; else put "No"; cards; LOXAPINE LOXBAGEL LOX NE LO ; run;

If I understand your request, you are asking whether you can search one list for any "hits" on another list. That would involve parsing. The INDEX() function merely scans a string for a match to a substring. That will lead to unintended matches such as the last two. S

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of saigovind chenna Sent: Friday, March 19, 2010 9:07 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Index question

Hello

Is there any way I can put all the required terms in a single single index statement?

index(medc, 'LOXITANE')>0 or

index(medc, 'LOXAPINE')>0 or

index(medc, 'LUDIOMIL')>0 or

index(medc, 'MAPROTILINE')>0 or

index(medc, 'LUVOX')>0 or

index(medc, 'FLUVOXAMINE')>0 or

index(medc, 'MAPROTILINE')>0 or

index(medc, 'LUDIOMIL')>0 or

index(medc, 'SERTRALINE')>0 or

index(medc, 'ZOLOFT')>0 or

index(medc, 'SERZONE')>0 or

index(medc, 'NEFAZODONE')>0 or

index(medc, 'STELAZINE')>0 or

index(medc, 'VESPRIN')>0 or

index(medc, 'TRIFLUOPERAZINE')>0 or

index(medc, 'SURMONTIL')>0 or

index(medc, 'TRIMIPRAMINE')>0 or

Saigovind Chenna


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