<?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: Find out Kth smallest in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736393#M229396</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a great solution I wish I had known about before (I really must go back and review proc summary).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT ... I think you need to replace "max(values)" with "min(values)"&lt;/P&gt;</description>
    <pubDate>Thu, 22 Apr 2021 13:45:54 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2021-04-22T13:45:54Z</dc:date>
    <item>
      <title>Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736322#M229361</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find out 8th and 29th smallest value from data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guide me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find attached sample data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 04:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736322#M229361</guid>
      <dc:creator>jitendrakoli</dc:creator>
      <dc:date>2021-04-22T04:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736324#M229363</link>
      <description>&lt;P&gt;Finding k-th smallest values has been discussed multiple times, the problem is even part of papers. So please search and adapt the things you find.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 05:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736324#M229363</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-04-22T05:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736328#M229367</link>
      <description>&lt;P&gt;You can identify the Kth obs by sorting in ascending order and specifying its obs number in _n_.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input values;
datalines;
1.01
1.17
0.97
1.26
1.19
1.12
0.76
0.87
0.72
0.94
0.89
0.84
0.85
0.98
0.81
1.06
1
0.94
0.79
0.91
0.76
0.98
0.93
0.88
0.9
1.04
0.86
1.12
1.06
1
0.81
0.94
0.78
1.01
0.95
0.9
;
run;

proc sort data=have;
  by values;
run;

data want;
  set have;
  if _n_=8 or _n_=29 then do;
    order=cats(_n_,'th');
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Apr 2021 05:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736328#M229367</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-22T05:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736363#M229385</link>
      <description>&lt;P&gt;Alternatively&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data = have;
   var values;
   output out = want(keep = values_8 values_29) idgroup (max(values) out[29] (values) = );
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Apr 2021 10:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736363#M229385</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-04-22T10:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736375#M229392</link>
      <description>Do you consider TIES value ?</description>
      <pubDate>Thu, 22 Apr 2021 11:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736375#M229392</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-22T11:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find out Kth smallest</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736393#M229396</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a great solution I wish I had known about before (I really must go back and review proc summary).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT ... I think you need to replace "max(values)" with "min(values)"&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 13:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-out-Kth-smallest/m-p/736393#M229396</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-04-22T13:45:54Z</dc:date>
    </item>
  </channel>
</rss>

