<?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: Select records with key words - prxmatch or any other functions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721445#M223609</link>
    <description>&lt;P&gt;Thank you PGStats for explaining.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&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;</description>
    <pubDate>Wed, 24 Feb 2021 01:37:51 GMT</pubDate>
    <dc:creator>Suzy_Cat</dc:creator>
    <dc:date>2021-02-24T01:37:51Z</dc:date>
    <item>
      <title>Select records with key words - prxmatch or any other functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721419#M223593</link>
      <description>&lt;P&gt;Hi wonderful helpers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help here to select the right records using wild match function:&lt;/P&gt;
&lt;P&gt;The data &lt;STRONG&gt;Want&lt;/STRONG&gt; should only include records with PID contains &lt;CODE class=" language-sas"&gt;A1|A7|A12&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;, i.e. only contains A followed by 1, 7 or 12:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;    
   infile datalines;  
   input PID $1-6 code $8 +1 date date9.; 
   datalines;          
AAA12b	7	13Aug2012
AAA124	1	13Aug2012
AAA12a	5	13Aug2012
bbA1aa	1	14Dec2018
bbA723	2	14Dec2018
ggA7ab	4	23Apr2012
ggg7cd	0	23Apr2012
;                          


data have;
set have;
format date date9.;
run;


data want;
set have;
if prxmatch("/A1|A7|A12/", PID);
if upcase(PID) ~="AAA124";
if upcase(PID) ~="BBA723";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 23:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721419#M223593</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2021-02-23T23:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with key words - prxmatch or any other functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721425#M223597</link>
      <description>&lt;P&gt;Use a negative look ahead assertion (?!...) in the match pattern and the i suffix (to make the match case insensitive):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if prxmatch("/A(1|7|12)(?!\d)/i", PID);
format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 23:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721425#M223597</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-02-23T23:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with key words - prxmatch or any other functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721445#M223609</link>
      <description>&lt;P&gt;Thank you PGStats for explaining.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&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;</description>
      <pubDate>Wed, 24 Feb 2021 01:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721445#M223609</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2021-02-24T01:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select records with key words - prxmatch or any other functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721530#M223656</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;    
   infile datalines;  
   input PID $1-6 code date : date9.; 
   format date date9.;
   datalines;   
AAAA12	7	13Aug2012 
AAA12b	7	13Aug2012
AAA124	1	13Aug2012
AAA12a	5	13Aug2012
bbA1aa	1	14Dec2018
bbA723	2	14Dec2018
ggA7ab	4	23Apr2012
ggg7cd	0	23Apr2012
;                          



data want;
set have;
if prxmatch("/(A1|A7|A12)\D/i", PID||' ');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Feb 2021 11:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-records-with-key-words-prxmatch-or-any-other-functions/m-p/721530#M223656</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-02-24T11:18:20Z</dc:date>
    </item>
  </channel>
</rss>

