<?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 keep a specific line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412350#M100848</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the following problem. I want to&amp;nbsp;keep&amp;nbsp;each line&amp;nbsp;in a month where &amp;nbsp;b is a maximum. For example, this is what I will keep :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.PNG" style="width: 218px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16565i145D8F96367B100D/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.PNG" alt="test.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you for your help&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2017 14:26:10 GMT</pubDate>
    <dc:creator>madix</dc:creator>
    <dc:date>2017-11-10T14:26:10Z</dc:date>
    <item>
      <title>keep a specific line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412350#M100848</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the following problem. I want to&amp;nbsp;keep&amp;nbsp;each line&amp;nbsp;in a month where &amp;nbsp;b is a maximum. For example, this is what I will keep :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.PNG" style="width: 218px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16565i145D8F96367B100D/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.PNG" alt="test.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 14:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412350#M100848</guid>
      <dc:creator>madix</dc:creator>
      <dc:date>2017-11-10T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: keep a specific line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412364#M100852</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* UNTESTED CODE */&lt;BR /&gt;proc sql;
&amp;nbsp; &amp;nbsp; create table want as select * from have group by mdy(month(f1),1,year(f1)) having b=max(b);
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 14:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412364#M100852</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-10T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: keep a specific line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412367#M100854</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;data inter;
  set have;
  mnth=month(f1);
run;
proc sort data=inter out=want;
  by mnth descending b;
run;

data want;
  set want;
  by mnth;
  if first.mnth;
run;&lt;/PRE&gt;
&lt;P&gt;Or you could do it in SQL by&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select * from have group by month(f1) having b=max(b);
quit;&lt;/PRE&gt;
&lt;P&gt;Or proc summary, or means.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 14:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412367#M100854</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-10T14:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: keep a specific line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412378#M100860</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;This works if all the dates are in the same year, doesn't work if the dates span multiple years.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412378#M100860</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-10T15:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: keep a specific line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412383#M100864</link>
      <description>&lt;P&gt;He never mentioned that, if so just change the month() function for a put():&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select * from have group by put(f1,mmyy6.) having b=max(b);
quit;&lt;/PRE&gt;
&lt;P&gt;Obviously not tested as don't have time to type his test data in.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keep-a-specific-line/m-p/412383#M100864</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-10T15:25:48Z</dc:date>
    </item>
  </channel>
</rss>

