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
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.