<?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 Choose the line with proc sql and prxmatch in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Choose-the-line-with-proc-sql-and-prxmatch/m-p/863909#M341200</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying reorganise my data with proc sql : I count tne number of supports by NO_C, in case of 2 I would like to chose the Major if it's present :&lt;/P&gt;
&lt;P&gt;input:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_0-1678745253650.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81482iE345A86E47A13F18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_0-1678745253650.png" alt="SASdevAnneMarie_0-1678745253650.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_1-1678745306552.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81483iB12D775C858A7FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_1-1678745306552.png" alt="SASdevAnneMarie_1-1678745306552.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm wondering how I can use if prxmatch("m/MAJORATION/oi",lb_sup)&amp;gt; 0 condition in proc sql ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 22:09:57 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2023-03-13T22:09:57Z</dc:date>
    <item>
      <title>Choose the line with proc sql and prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Choose-the-line-with-proc-sql-and-prxmatch/m-p/863909#M341200</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying reorganise my data with proc sql : I count tne number of supports by NO_C, in case of 2 I would like to chose the Major if it's present :&lt;/P&gt;
&lt;P&gt;input:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_0-1678745253650.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81482iE345A86E47A13F18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_0-1678745253650.png" alt="SASdevAnneMarie_0-1678745253650.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_1-1678745306552.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81483iB12D775C858A7FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_1-1678745306552.png" alt="SASdevAnneMarie_1-1678745306552.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm wondering how I can use if prxmatch("m/MAJORATION/oi",lb_sup)&amp;gt; 0 condition in proc sql ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 22:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Choose-the-line-with-proc-sql-and-prxmatch/m-p/863909#M341200</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-03-13T22:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Choose the line with proc sql and prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Choose-the-line-with-proc-sql-and-prxmatch/m-p/863921#M341204</link>
      <description>&lt;P&gt;This is a bit ugly but here is one way based on limited data. I don't think PRXMATCH is the best option here even if it does work in SQL (I haven't tried).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input @1 NO_C $6.
        @8 lb_sup $10.
		@19 nb_supp 2.
		@21 top_supp_major 2.
		;
datalines;
JO2886 MINIMUM    2  0
JO2886 MAJORATION 2  1
B00405 MAJORATION 2  1
B00405 ACTIV1     2  0
B00867 ACTIV1     2  0
;
run;

proc sql;
  create table want as
  select *
  from have
  where top_supp_major = 1
  or (NO_C in 
      (select NO_C
       from have
       where top_supp_major = 0
       except
       select NO_C
       from have
       where top_supp_major = 1
      )
     );
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 19:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Choose-the-line-with-proc-sql-and-prxmatch/m-p/863921#M341204</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-14T19:01:04Z</dc:date>
    </item>
  </channel>
</rss>

