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 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 28 Apr 2000 11:24:54 -0500
Reply-To:     Anthony.Kilili@BMGDIRECT.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Anthony Kilili <Anthony.Kilili@BMGDIRECT.COM>
Subject:      Re: Finding a string in a variable
Comments: To: foster@CYBERPORTAL.NET
Content-Type: text/plain; charset="iso-8859-1"

If index(string, 'Minnesota') and index(string, 'brown') ne 0;

Will select the observation with 'The brown cow is from Minnesota' and will not select the observation with the string 'The white elephant is from Washington DC'.

Anthony

-----Original Message----- From: Foster Kerrison [mailto:foster@CYBERPORTAL.NET] Sent: Friday, April 28, 2000 11:03 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Finding a string in a variable

Is there a way to "select" a string in a variable in order to select that observation?

For example lets say that the variable content is:

'The brown cow is from Minnesota'.

Can I look for Minnesota in this string, and select this observation as distinct from a cow from Wyoming, or even a black cow? The string (Minnesota/Wyoming/Black cow) could appear anywhere in the variable content?

Foster Kerrison.


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