<?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 Choosing minimum value on matching variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345138#M79368</link>
    <description>&lt;P&gt;I have this dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
  infile datalines;
  input id r2d2 price;
  datalines;
15 12 10
15 12 14
22 17 12
88 16 23
22 17 10
22 15 34
88 15 95
;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I'd like to do is - for observations that have the same value for r2d2, I want to output only the observation with the lowest price. How would I go about doing this&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2017 19:34:25 GMT</pubDate>
    <dc:creator>JediApprentice</dc:creator>
    <dc:date>2017-03-28T19:34:25Z</dc:date>
    <item>
      <title>Choosing minimum value on matching variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345138#M79368</link>
      <description>&lt;P&gt;I have this dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
  infile datalines;
  input id r2d2 price;
  datalines;
15 12 10
15 12 14
22 17 12
88 16 23
22 17 10
22 15 34
88 15 95
;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I'd like to do is - for observations that have the same value for r2d2, I want to output only the observation with the lowest price. How would I go about doing this&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345138#M79368</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2017-03-28T19:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing minimum value on matching variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345144#M79371</link>
      <description>&lt;P&gt;Sort the data so that the smallest value is first and then use SAS FIRST logic to keep the record.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345144#M79371</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-28T19:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing minimum value on matching variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345146#M79372</link>
      <description>&lt;P&gt;An SQL solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--- UNTESTED CODE ----&lt;/P&gt;
&lt;PRE&gt;proc sql;
    create table new as select * from x group by r2d2 having price=min(price);
quit;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Choosing-minimum-value-on-matching-variable/m-p/345146#M79372</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-03-28T19:45:37Z</dc:date>
    </item>
  </channel>
</rss>

