<?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/How-to-find-the-3rd-value-of-each-group/m-p/562175#M157463</link>
    <description>&lt;P&gt;Welcome to the SAS community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a Proc Sort and sort by height.&lt;/P&gt;
&lt;P&gt;Then use a data step, set...; by height and select the 3rd observation (if _n_=3) - or alternatively use the obs and firstobs dataset options for the table used with the SET statement to directly select the 3rd option only.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 07:17:05 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-05-29T07:17:05Z</dc:date>
    <item>
      <title>How to find the 3rd value of each group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562174#M157462</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How To Find out third height in sashelp.class by using data step and proc step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Advance Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 16:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562174#M157462</guid>
      <dc:creator>nayab_shaik</dc:creator>
      <dc:date>2019-05-29T16:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562175#M157463</link>
      <description>&lt;P&gt;Welcome to the SAS community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a Proc Sort and sort by height.&lt;/P&gt;
&lt;P&gt;Then use a data step, set...; by height and select the 3rd observation (if _n_=3) - or alternatively use the obs and firstobs dataset options for the table used with the SET statement to directly select the 3rd option only.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 07:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562175#M157463</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-29T07:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562179#M157464</link>
      <description>&lt;P&gt;Using PROC RANK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=sashelp.class out=want(where=(Rank=3)) descending ties=dense;
   var height;
   ranks Rank;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 07:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562179#M157464</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-29T07:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562189#M157468</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
if 0 then set sashelp.class;
declare hash h(dataset:'sashelp.class',ordered: 'a');
  h.definekey('height');
  h.definedata(ALL:'YES');
  h.definedone();
  h.output(dataset:'want');
RUN;
*now see the data has already been sort by name age;
PROC PRINT data=want(firstobs=3 obs=3);RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 08:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562189#M157468</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2019-05-29T08:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562209#M157476</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275954"&gt;@nayab_shaik&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;How To Find out third height in sashelp.class by using data step and proc step&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given your question I assume you're a total beginner and that this is sort of an almost first exercise for you. If that's true then please ignore any of the more advanced coding suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my opinion Proc Rank is the "best" approach as it also deals with ties. So that's likely one of the Proc's you're going to look into in one of your next lessons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now keep it simple and on your level. Below is "spoiler" code. It would be better to first try on your own as that's how you learn.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Going forward: People are more than happy to help here but I suggest always try first on your own and then eventually post your not yet working code and explain us where you're stuck. Doing it this way will give you often very helpful answers from which you can learn a lot. And the answers will be more likely on your skill level as looking into your code people can better understand where you're coming from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=work.class;
  by height;
run;

data want_1;
  set work.class;
  by height;
  if _n_=3;
run;

data want_2;
  set work.class(firstobs=3 obs=3);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562209#M157476</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-29T09:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562245#M157489</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=sashelp.class nextrval=3;
var height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 12:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-3rd-value-of-each-group/m-p/562245#M157489</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-05-29T12:45:53Z</dc:date>
    </item>
  </channel>
</rss>

