<?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: categorize variable based on matching words in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449560#M113145</link>
    <description>&lt;P&gt;Thanks. You are correct. I had some small syntax errors and some classification errors. All works now.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 02:49:36 GMT</pubDate>
    <dc:creator>eemrun</dc:creator>
    <dc:date>2018-03-29T02:49:36Z</dc:date>
    <item>
      <title>categorize variable based on matching words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449197#M113030</link>
      <description>&lt;P&gt;I am trying to create&amp;nbsp; an expense report where I am categorizing transactions based on certain keywords (e.g. if a transaction line contains STARBUCKS, categorize it as EATING-OUT). I am using the following but notice that the command does not always work (as in does not assign transactions to categories all the time. Is there a better way to do this other than the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	if prxmatch ("m/BAKE &amp;amp; BEANS|Smart Sushi |Columbus Coffee|Coffee Club|Mozaic|Menulog|Kyoto|Baxters|
		NZ Natural|Rio|yoway|yoghurt||Dogmatic|Donut|Thanya|Nol|Bean/i",details) &amp;gt; 0 then
		Category = "Eat-Out";&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 01:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449197#M113030</guid>
      <dc:creator>eemrun</dc:creator>
      <dc:date>2018-03-28T01:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: categorize variable based on matching words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449203#M113031</link>
      <description>&lt;P&gt;There is no reason this should fail if done properly.&lt;/P&gt;
&lt;P&gt;Do you have an example of data that is missed?&lt;/P&gt;
&lt;P&gt;Note that you have a double pipe ||&amp;nbsp; in the example you gave.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or...&amp;nbsp; Could it be that you look for spaces when you shouldn't?&amp;nbsp;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if prxmatch ("m/BAKE &amp;amp; BEANS|Smart Sushi |Columbus Coffee|Coffee Club|Mozaic|Menulog|Kyoto|Baxters|"
           ||"NZ Natural|Rio|yoway|yoghurt|Dogmatic|Donut|Thanya|Nol|Bean/i",details&lt;BR /&gt;            ) &amp;gt; 0 then category = "Eat-Out";&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 02:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449203#M113031</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-28T02:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: categorize variable based on matching words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449560#M113145</link>
      <description>&lt;P&gt;Thanks. You are correct. I had some small syntax errors and some classification errors. All works now.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 02:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/categorize-variable-based-on-matching-words/m-p/449560#M113145</guid>
      <dc:creator>eemrun</dc:creator>
      <dc:date>2018-03-29T02:49:36Z</dc:date>
    </item>
  </channel>
</rss>

