<?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: How to select rows that contain specific words in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670510#M201302</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(company,'WALMART',' ','i')&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This searches ignoring case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but since there can be a hyphen in the company name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(company,'WALMART',' ','i')&amp;gt;0 or findw(company,'WAL-MART',' ','i')&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or maybe this: (UNTESTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(compress(company,,'p'),'WALMART',' ','i');&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 19 Jul 2020 20:43:17 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-07-19T20:43:17Z</dc:date>
    <item>
      <title>How to select rows that contain specific words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670508#M201301</link>
      <description>&lt;P&gt;I have a list of company names and I would like to subtract the rows with certain company names and create a new file. As company names are given in capital (WALMART), lowercase(walmart), hyphen in the middle (Wal-Mart) or mixed with other words (WALMART SUPERMARKET), I need multiple words to include. Basically, I want the observations that contain 'WALMART' or any similar word in it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Company&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Walmart&lt;/P&gt;
&lt;P&gt;WALMART&lt;/P&gt;
&lt;P&gt;Wal-MART&lt;/P&gt;
&lt;P&gt;WALMART SUPERMARKET&lt;/P&gt;
&lt;P&gt;WALMART PHARMACY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the code below, but it didn't work.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;20 data all.walmart;&lt;BR /&gt;21 set all.retailstore;&lt;BR /&gt;22 if findw(company,'WALMART')&amp;gt;0;&lt;BR /&gt;23 if findw(company,'walmart')&amp;gt;0 ;&lt;BR /&gt;24 if findw(company,'Walmart')&amp;gt;0 ;&lt;BR /&gt;25 if findw(company,'Wal-mart')&amp;gt;0 ;&lt;BR /&gt;26 if findw(company,'WAL-MART')&amp;gt;0 ;&lt;BR /&gt;27 run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jul 2020 20:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670508#M201301</guid>
      <dc:creator>cphd</dc:creator>
      <dc:date>2020-07-19T20:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows that contain specific words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670510#M201302</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(company,'WALMART',' ','i')&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This searches ignoring case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but since there can be a hyphen in the company name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(company,'WALMART',' ','i')&amp;gt;0 or findw(company,'WAL-MART',' ','i')&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or maybe this: (UNTESTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(compress(company,,'p'),'WALMART',' ','i');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jul 2020 20:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670510#M201302</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-19T20:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to select rows that contain specific words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670515#M201304</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*? Quantifier — Matches between zero and one times*/
data all.walmart;;
	set all.retailstore;
	if prxmatch('/wal-?mart/io',company);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jul 2020 21:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-rows-that-contain-specific-words/m-p/670515#M201304</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2020-07-19T21:02:19Z</dc:date>
    </item>
  </channel>
</rss>

