<?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: SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562303#M157510</link>
    <description>&lt;P&gt;Sort by sex and descending weight.&lt;/P&gt;
&lt;P&gt;In a data step with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by sex;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if first.sex&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to set a counter to 1, otherwise increment counter with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;counter + 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use a subsetting if&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if counter = 3;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to only output the third observation for each group. I intentionally leave writing the whole code to you, so you have opportunity for learning.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 14:40:33 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-05-29T14:40:33Z</dc:date>
    <item>
      <title>Find the third highest value from each group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562256#M157492</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;write sas code to find out 3rd max weight on each sex group wise from sashelp.class by using data step programming&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 16:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562256#M157492</guid>
      <dc:creator>nayab_shaik</dc:creator>
      <dc:date>2019-05-29T16:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562303#M157510</link>
      <description>&lt;P&gt;Sort by sex and descending weight.&lt;/P&gt;
&lt;P&gt;In a data step with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by sex;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if first.sex&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to set a counter to 1, otherwise increment counter with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;counter + 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use a subsetting if&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if counter = 3;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to only output the third observation for each group. I intentionally leave writing the whole code to you, so you have opportunity for learning.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 14:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562303#M157510</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-29T14:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562304#M157511</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275954"&gt;@nayab_shaik&lt;/a&gt;&amp;nbsp;it would be helpful to all of us if you could use meaningful titles for your posts, instead of "SAS". For example, could you please change the title of this thread to "Find 3rd highest in a group"?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 14:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562304#M157511</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-29T14:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562310#M157515</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= sashelp.class out= class_check;&lt;BR /&gt;by sex descending Weight ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data class_check2;&lt;BR /&gt;set class_check;&lt;BR /&gt;by sex descending Weight;&lt;BR /&gt;if first.sex then counter=0;&lt;BR /&gt;counter+1;&lt;BR /&gt;if counter=3 then output;&lt;BR /&gt;drop name age counter;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anushree&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 15:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562310#M157515</guid>
      <dc:creator>anushreebiotech</dc:creator>
      <dc:date>2019-05-29T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562317#M157516</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by  sex descending weight;
run;

proc rank data=class out=rank_3(where=(weight_rank=3)) descending;
by sex;
var weight;
ranks weight_rank;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If there are ties, how would you like to resolve them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 15:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-third-highest-value-from-each-group/m-p/562317#M157516</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2019-05-29T15:27:44Z</dc:date>
    </item>
  </channel>
</rss>

