<?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: Using prxmatch to EXCLUDE words in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810723#M319727</link>
    <description>&lt;P&gt;I don't have data immediately available but here's my data step as an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test1;&lt;BR /&gt;set test;&lt;BR /&gt;if&amp;nbsp;prxmatch("m/word1|word2|word3/io", variable) &amp;gt; 0;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead including word1, word2, and word3 in output, I want to exclude those.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just now, I thought that if I include "then delete" after the if statement, it might do what I want.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2022 18:45:42 GMT</pubDate>
    <dc:creator>vegan_renegade</dc:creator>
    <dc:date>2022-04-29T18:45:42Z</dc:date>
    <item>
      <title>Using prxmatch to EXCLUDE words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810712#M319719</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I would like to use PRXmatch to exclude the words in the argument rather than the usual include. Is there an option or modifier to do this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810712#M319719</guid>
      <dc:creator>vegan_renegade</dc:creator>
      <dc:date>2022-04-29T18:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using prxmatch to EXCLUDE words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810715#M319721</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf" target="_blank"&gt;https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maguiremq_0-1651256583218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70990i53E858F009FECC96/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maguiremq_0-1651256583218.png" alt="maguiremq_0-1651256583218.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is what you want. Without example data, we can't know what you need.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810715#M319721</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2022-04-29T18:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using prxmatch to EXCLUDE words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810723#M319727</link>
      <description>&lt;P&gt;I don't have data immediately available but here's my data step as an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test1;&lt;BR /&gt;set test;&lt;BR /&gt;if&amp;nbsp;prxmatch("m/word1|word2|word3/io", variable) &amp;gt; 0;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead including word1, word2, and word3 in output, I want to exclude those.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just now, I thought that if I include "then delete" after the if statement, it might do what I want.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810723#M319727</guid>
      <dc:creator>vegan_renegade</dc:creator>
      <dc:date>2022-04-29T18:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using prxmatch to EXCLUDE words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810726#M319729</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input variable :$25.;
datalines;
word1
word2
word99
whatisaword
wordle
what
;
run;

data want;
	set have;
		if prxmatch("/[^(word1|word2|word3)]/", trim(variable)) &amp;gt; 0;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maguiremq_0-1651258328593.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70991iDFA94C9E66549C67/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maguiremq_0-1651258328593.png" alt="maguiremq_0-1651258328593.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But even then, I'm wondering if you have extra whitespace or you could literally just switch the condition (&amp;gt;0). I can't tell without example data.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810726#M319729</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2022-04-29T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using prxmatch to EXCLUDE words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810742#M319739</link>
      <description>&lt;P&gt;Thanks, just figured it out.&amp;nbsp; It's as simple as including &lt;STRONG&gt;not&lt;/STRONG&gt; in front of prxmatch:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if &lt;STRONG&gt;not&lt;/STRONG&gt; prxmatch(arguments)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 20:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-prxmatch-to-EXCLUDE-words/m-p/810742#M319739</guid>
      <dc:creator>vegan_renegade</dc:creator>
      <dc:date>2022-04-29T20:33:44Z</dc:date>
    </item>
  </channel>
</rss>

