<?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 Re: finding a word anywhere in a stirng in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722269#M223930</link>
    <description>Thank you both!</description>
    <pubDate>Fri, 26 Feb 2021 22:08:58 GMT</pubDate>
    <dc:creator>lillymaginta1</dc:creator>
    <dc:date>2021-02-26T22:08:58Z</dc:date>
    <item>
      <title>finding a word anywhere in a stirng</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722255#M223924</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards ;
input ID   drugname ;	 
cards;
001 sodium benzoate 
001 oral sodium 
003 oral potassium 
004 oral oral Sodium 
004 Sodium 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to retain 1 if the word sodium exist anywhere in the variable "drugname". The word can be written in capital and small letters.&lt;/P&gt;
&lt;P&gt;Output&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID sodium 
001 1
001 1
003 0
004 1
004 1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722255#M223924</guid>
      <dc:creator>lillymaginta1</dc:creator>
      <dc:date>2021-02-26T21:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: finding a word anywhere in a stirng</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722265#M223927</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile cards ;
input ID   drugname &amp;amp; $20.;	 
cards;
001 sodium benzoate 
001 oral sodium 
003 oral potassium 
004 oral oral Sodium 
004 Sodium 
;

data want;
 set have;
 sodium=^^findw(drugname,'sodium',' ','i');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722265#M223927</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-02-26T21:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: finding a word anywhere in a stirng</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722266#M223928</link>
      <description>&lt;P&gt;FINDW()?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(lowcase(drugname), "sodium") &amp;gt; 0;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p16rdsa30vmm43n1ej4936nwa01t.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p16rdsa30vmm43n1ej4936nwa01t.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69937"&gt;@lillymaginta1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards ;
input ID   drugname ;	 
cards;
001 sodium benzoate 
001 oral sodium 
003 oral potassium 
004 oral oral Sodium 
004 Sodium 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to retain 1 if the word sodium exist anywhere in the variable "drugname". The word can be written in capital and small letters.&lt;/P&gt;
&lt;P&gt;Output&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID sodium 
001 1
001 1
003 0
004 1
004 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722266#M223928</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-26T21:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: finding a word anywhere in a stirng</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722269#M223930</link>
      <description>Thank you both!</description>
      <pubDate>Fri, 26 Feb 2021 22:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-a-word-anywhere-in-a-stirng/m-p/722269#M223930</guid>
      <dc:creator>lillymaginta1</dc:creator>
      <dc:date>2021-02-26T22:08:58Z</dc:date>
    </item>
  </channel>
</rss>

