<?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: max value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294590#M60074</link>
    <description>or&lt;BR /&gt;proc means data=sortedOutput noprint;&lt;BR /&gt;class id ; by year;&lt;BR /&gt;var value;&lt;BR /&gt;output out=want3 max(value)=;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;thx u</description>
    <pubDate>Sat, 27 Aug 2016 17:15:51 GMT</pubDate>
    <dc:creator>ESSALAHBENNANI</dc:creator>
    <dc:date>2016-08-27T17:15:51Z</dc:date>
    <item>
      <title>max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294584#M60070</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class="vote"&gt;&lt;DIV class="favoritecount"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV&gt;&lt;DIV class="post-text"&gt;&lt;P&gt;Each ID has several instances, and each instance has a different value. I would like the final output to be the maximum value per ID and per year. So the initial dataset is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ID   year  Value
 1   2012   100
 1   2013   7
 1   2013   65
 2   2015   12
 2   2015   97
 3   2011   82
 3   2012   54&lt;BR /&gt; 3   2012   95&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output will be :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; ID   year  Value
 1    2012   100
 1    2013   65&lt;BR /&gt; 2    2015   97
 3    2011   82&lt;BR /&gt; 3    2012   95&lt;BR /&gt;&lt;SPAN&gt;I tried running proc means :&lt;BR /&gt;proc means data=H10 noprint;&lt;BR /&gt; class ID year ; &lt;BR /&gt; var value;&lt;BR /&gt; output out=want max(value)=;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;but it dosen't work.&lt;BR /&gt;&lt;BR /&gt;thx u very much.&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 15:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294584#M60070</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-08-27T15:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294587#M60072</link>
      <description>&lt;P&gt;try proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table max as select id, year, max(value) as value from have group by id, year;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 16:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294587#M60072</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-08-27T16:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294588#M60073</link>
      <description>&lt;P&gt;with proc means try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have noprint;
by id year;
var value;
output out=max max=value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Aug 2016 16:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294588#M60073</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-08-27T16:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294590#M60074</link>
      <description>or&lt;BR /&gt;proc means data=sortedOutput noprint;&lt;BR /&gt;class id ; by year;&lt;BR /&gt;var value;&lt;BR /&gt;output out=want3 max(value)=;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;thx u</description>
      <pubDate>Sat, 27 Aug 2016 17:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294590#M60074</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-08-27T17:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294592#M60075</link>
      <description>&lt;P&gt;Your original code was correct, you don't specify how it was wrong but I suspect it had too many points because it calculates ALL interactions between year and ID, so the max for each ID, the max for each year and then the max for each Year/ID which is the one you actually want. You can limit your results with the NWAY option.&lt;/P&gt;
&lt;P&gt;I like to specify the variable name, but its not required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=H10 noprint NWAY;
 class ID year ; 
 var value;
 output out=want max(value)=max_value;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 18:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294592#M60075</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-27T18:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: max value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294596#M60077</link>
      <description>&lt;P&gt;exactly thx u verry much&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2016 19:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/max-value/m-p/294596#M60077</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-08-27T19:47:12Z</dc:date>
    </item>
  </channel>
</rss>

