<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Finding String in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26204#M5965</link>
    <description>Hello all,&lt;BR /&gt;
&lt;BR /&gt;
I am a situation where i have dataset with two variables name and alias:&lt;BR /&gt;
&lt;BR /&gt;
Name              Alias&lt;BR /&gt;
xxx_999_aa     999&lt;BR /&gt;
vvv_156_bb      156&lt;BR /&gt;
&lt;BR /&gt;
My requirement is to find the alias in the name,so as per below  i need to find if 999 or 156 is present in names.I tried using the FIND function like the following;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
set a;&lt;BR /&gt;
x=find(name,alias);&lt;BR /&gt;
if x &amp;gt; 0 then delete;&lt;BR /&gt;
run;&lt;BR /&gt;
but this does not seems working as the value of the x is getting assigned as  0.&lt;BR /&gt;
&lt;BR /&gt;
Please help</description>
    <pubDate>Mon, 01 Nov 2010 23:19:44 GMT</pubDate>
    <dc:creator>ren2010</dc:creator>
    <dc:date>2010-11-01T23:19:44Z</dc:date>
    <item>
      <title>Finding String</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26204#M5965</link>
      <description>Hello all,&lt;BR /&gt;
&lt;BR /&gt;
I am a situation where i have dataset with two variables name and alias:&lt;BR /&gt;
&lt;BR /&gt;
Name              Alias&lt;BR /&gt;
xxx_999_aa     999&lt;BR /&gt;
vvv_156_bb      156&lt;BR /&gt;
&lt;BR /&gt;
My requirement is to find the alias in the name,so as per below  i need to find if 999 or 156 is present in names.I tried using the FIND function like the following;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
set a;&lt;BR /&gt;
x=find(name,alias);&lt;BR /&gt;
if x &amp;gt; 0 then delete;&lt;BR /&gt;
run;&lt;BR /&gt;
but this does not seems working as the value of the x is getting assigned as  0.&lt;BR /&gt;
&lt;BR /&gt;
Please help</description>
      <pubDate>Mon, 01 Nov 2010 23:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26204#M5965</guid>
      <dc:creator>ren2010</dc:creator>
      <dc:date>2010-11-01T23:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Finding String</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26205#M5966</link>
      <description>The alias might have trailing or leading blanks, and then you're searching for &lt;BR /&gt;
'  999' or '999  ' rather than 999.  &lt;BR /&gt;
&lt;BR /&gt;
Try using the compress function on alias:&lt;BR /&gt;
	&lt;BR /&gt;
&lt;BR /&gt;
x=find(name, compress(alias));&lt;BR /&gt;
y=find(name, alias);</description>
      <pubDate>Mon, 01 Nov 2010 23:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26205#M5966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2010-11-01T23:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Finding String</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26206#M5967</link>
      <description>without your log and contents it is hard to pinpoint.  Some suggestions.&lt;BR /&gt;
&lt;BR /&gt;
-- Make sure both variables are character.&lt;BR /&gt;
-- Make sure the alias does not have either leading or trailing blanks in it (print alias with a hex format to see what SAS thinks is there).&lt;BR /&gt;
-- You might try the code&lt;BR /&gt;
x=find(name,trim(left(alias)));&lt;BR /&gt;
to see if that helps.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Mon, 01 Nov 2010 23:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26206#M5967</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-11-01T23:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Finding String</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26207#M5968</link>
      <description>Thank you all</description>
      <pubDate>Tue, 02 Nov 2010 02:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Finding-String/m-p/26207#M5968</guid>
      <dc:creator>ren2010</dc:creator>
      <dc:date>2010-11-02T02:40:34Z</dc:date>
    </item>
  </channel>
</rss>

