<?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 Top N values in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716373#M221383</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs=5;
select  age from sashelp.class;
group by age;
order by age desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Top N Values&amp;nbsp; how to get&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 11:09:47 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2021-02-03T11:09:47Z</dc:date>
    <item>
      <title>Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716373#M221383</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs=5;
select  age from sashelp.class;
group by age;
order by age desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Top N Values&amp;nbsp; how to get&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716373#M221383</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-02-03T11:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716374#M221384</link>
      <description>&lt;P&gt;Sort by descending and take the first N values of that.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716374#M221384</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-03T11:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716378#M221388</link>
      <description>i am not getting ouput</description>
      <pubDate>Wed, 03 Feb 2021 11:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716378#M221388</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-02-03T11:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716380#M221390</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your SQL code is only one instruction so you only need a semi-colon at the end.&lt;/P&gt;
&lt;P&gt;You also need to add the DISTINCT keyword.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs=5;
select distinct age from sashelp.class
order by age desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;EDIT: removed group by. &lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716380#M221390</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2021-02-03T11:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716381#M221391</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = sashelp.class out = temp;
   by descending age;
run;

data want;
   set temp (keep = age obs = 5);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716381#M221391</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-03T11:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716388#M221396</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i am not getting ouput&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please post the code you use and the complete log. Both as text!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716388#M221396</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-02-03T11:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Top N values in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716440#M221424</link>
      <description>&lt;P&gt;In addition the solutions given, you might also want to learn how to create a table and bar chart of the Top N values by using PROC FREQ:&amp;nbsp; &lt;A href="https://blogs.sas.com/content/iml/2018/06/04/top-10-table-bar-chart.html" target="_self"&gt;How to create a&amp;nbsp;"Top 10" table and bar chart&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Top-N-values-in-sas/m-p/716440#M221424</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-02-03T13:59:39Z</dc:date>
    </item>
  </channel>
</rss>

