<?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 pull the hishest number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306775#M65632</link>
    <description>&lt;P&gt;I have a table as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp;term &amp;nbsp; &amp;nbsp;crh &amp;nbsp; &amp;nbsp;sub &amp;nbsp; point&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sci &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to pull if id term crh and sub same, but points are different. pull the highest points. So output as belo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp;term &amp;nbsp; &amp;nbsp;crh &amp;nbsp; &amp;nbsp;sub &amp;nbsp; point&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sci &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 3&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 13:43:19 GMT</pubDate>
    <dc:creator>user24</dc:creator>
    <dc:date>2016-10-24T13:43:19Z</dc:date>
    <item>
      <title>pull the hishest number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306775#M65632</link>
      <description>&lt;P&gt;I have a table as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp;term &amp;nbsp; &amp;nbsp;crh &amp;nbsp; &amp;nbsp;sub &amp;nbsp; point&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sci &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to pull if id term crh and sub same, but points are different. pull the highest points. So output as belo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp;term &amp;nbsp; &amp;nbsp;crh &amp;nbsp; &amp;nbsp;sub &amp;nbsp; point&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;25 &amp;nbsp; &amp;nbsp;2014 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sci &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp; &amp;nbsp;2011 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mat &amp;nbsp; 3&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 13:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306775#M65632</guid>
      <dc:creator>user24</dc:creator>
      <dc:date>2016-10-24T13:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: pull the hishest number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306788#M65637</link>
      <description>&lt;P&gt;Simple proc sort nodupkey:&lt;/P&gt;
&lt;PRE&gt;proc sort data=have out=want nodupkey;
  by id term crh sub descending point;
run;&lt;/PRE&gt;
&lt;P&gt;Note the descending before point so highest is first.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306788#M65637</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-24T14:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: pull the hishest number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306790#M65639</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by id term crh sub point;
run;

data want;
set have;
by id term crh sub;
if last.crh;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select id, term, crh, sub, max(point) as point
from have
group by id, term, crh, sub
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306790#M65639</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-24T14:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: pull the hishest number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306828#M65657</link>
      <description>&lt;P&gt;This may be fastest, but requires a lot of memory if your data set is large:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;class id term crh sub;&lt;/P&gt;
&lt;P&gt;var point;&lt;/P&gt;
&lt;P&gt;output out=want (drop=_freq_ _type_) max=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pull-the-hishest-number/m-p/306828#M65657</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-24T14:49:52Z</dc:date>
    </item>
  </channel>
</rss>

