<?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: Compare rows in a dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622514#M19783</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; , add &lt;STRONG&gt;descending limit&lt;/STRONG&gt; to the sort criteria to fulfill OP second requirement. &lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2020 18:33:54 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-02-05T18:33:54Z</dc:date>
    <item>
      <title>Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622509#M19780</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have sample data below :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Account_No&amp;nbsp; &amp;nbsp;Limit&amp;nbsp; &amp;nbsp; &amp;nbsp;Score&lt;/P&gt;&lt;P&gt;========&amp;nbsp; &amp;nbsp; &amp;nbsp;=====&amp;nbsp; &amp;nbsp; ====&lt;/P&gt;&lt;P&gt;11111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000&amp;nbsp; &amp;nbsp; &amp;nbsp;14.34&lt;/P&gt;&lt;P&gt;11111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp;11.29&lt;/P&gt;&lt;P&gt;22222&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; &amp;nbsp;18.23&lt;/P&gt;&lt;P&gt;22222&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000&amp;nbsp; &amp;nbsp; &amp;nbsp;21.01&lt;/P&gt;&lt;P&gt;33333&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3000&amp;nbsp; &amp;nbsp; &amp;nbsp;12.22&lt;/P&gt;&lt;P&gt;33333&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000&amp;nbsp; &amp;nbsp; &amp;nbsp;12.22&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to compare the score column values when we have multiple entries for the same account number and keep:-&lt;/P&gt;&lt;P&gt;#1) the lowest score value row for the account number&lt;/P&gt;&lt;P&gt;#2) If the score value is same , then I need to pick up highest limit value row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output data:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Account_No&amp;nbsp; &amp;nbsp;Limit&amp;nbsp; &amp;nbsp; &amp;nbsp;Score&lt;/P&gt;&lt;P&gt;========&amp;nbsp; &amp;nbsp; &amp;nbsp;=====&amp;nbsp; &amp;nbsp; ====&lt;/P&gt;&lt;P&gt;11111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp;11.29&lt;/P&gt;&lt;P&gt;22222&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; &amp;nbsp;18.23&lt;/P&gt;&lt;P&gt;33333&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3000&amp;nbsp; &amp;nbsp; &amp;nbsp;12.22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone suggest me a logic to achieve this ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashok&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622509#M19780</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2020-02-05T18:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622511#M19781</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=your_dataset out=sorted_dsn;

by account_no score;

run;



data want_dsn;

&amp;nbsp;set sorted_dsn;

by account_no;

if first.account_no;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622511#M19781</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-02-05T18:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622514#M19783</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; , add &lt;STRONG&gt;descending limit&lt;/STRONG&gt; to the sort criteria to fulfill OP second requirement. &lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622514#M19783</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-02-05T18:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622516#M19784</link>
      <description>&lt;P&gt;I think a slight variation on the suggested program would work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
   by account_no score descending limit;
run;

data want;
   set have;
   by account_no;
   if first.account_no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622516#M19784</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-02-05T18:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622518#M19785</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp; Thank you as I failed to notice the 2nd one and went for lunch. Well,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp; has answered it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622518#M19785</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-02-05T18:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622522#M19786</link>
      <description>&lt;P&gt;Thanks. It makes sense, let me try it out.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 18:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-rows-in-a-dataset/m-p/622522#M19786</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2020-02-05T18:46:06Z</dc:date>
    </item>
  </channel>
</rss>

