<?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: if first.id in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299701#M60472</link>
    <description>&lt;P&gt;i did try it and&amp;nbsp; for small dataset it worked but not&amp;nbsp; sure&amp;nbsp; if they were just a&amp;nbsp; coincidence &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 21:16:05 GMT</pubDate>
    <dc:creator>Tal</dc:creator>
    <dc:date>2016-09-20T21:16:05Z</dc:date>
    <item>
      <title>if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299694#M60469</link>
      <description>&lt;P&gt;hi guys,&lt;/P&gt;
&lt;P&gt;i have&amp;nbsp; a dataset something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;company_name Employee_id ranking&lt;/P&gt;
&lt;P&gt;ibm&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;ibm&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;ibm&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;apple 104&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;
&lt;P&gt;apple 104&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;........................&lt;/P&gt;
&lt;P&gt;..........................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i need to pick the record of the empoyeer with the&amp;nbsp; highest ranking&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ibm&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;
&lt;P&gt;ibm&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;apple 104&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so was wondering if my logic&amp;nbsp; is right:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;by comp_name emp_id desecending ranking;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have&lt;/P&gt;
&lt;P&gt;by&amp;nbsp;comp_name emp_id desecending ranking;&lt;/P&gt;
&lt;P&gt;if first.emp_id?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 21:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299694#M60469</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2016-09-20T21:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299700#M60471</link>
      <description>&lt;P&gt;Fastest way is to try it. Best part about most programming is it's quick and easy to try things.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should always have a method to test your logic, relying on a forum isn't a good way &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 21:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299700#M60471</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-20T21:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299701#M60472</link>
      <description>&lt;P&gt;i did try it and&amp;nbsp; for small dataset it worked but not&amp;nbsp; sure&amp;nbsp; if they were just a&amp;nbsp; coincidence &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 21:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299701#M60472</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2016-09-20T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299708#M60473</link>
      <description>&lt;P&gt;That's why you build test cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generate a basic case, then what happens if you have one one record per id, multiple records per id, multiple id's and finally, what if you have ties?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 23:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299708#M60473</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-20T23:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299735#M60474</link>
      <description>&lt;P&gt;Submitting that code will return an error. Before testing your logic, you will need the correct syntax. Keyword&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;desecending&lt;/EM&gt;&lt;/STRONG&gt; should be spelled&amp;nbsp;&lt;STRONG&gt;descending.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 03:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299735#M60474</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-09-21T03:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: if first.id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299826#M60478</link>
      <description>&lt;P&gt;so&amp;nbsp; to confirm&amp;nbsp; that logic works&amp;nbsp; i created a&amp;nbsp; temp flag =cats( comp_name, emp_id) and then sorted by tempflag ranking and applied&amp;nbsp;"if first.tempflag" and got the same&amp;nbsp; result as&amp;nbsp;i got&amp;nbsp;with the above approach so i guess&amp;nbsp;&amp;nbsp;i was on the&amp;nbsp; right&amp;nbsp; track&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;never had such situations so i was not sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 13:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-first-id/m-p/299826#M60478</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2016-09-21T13:23:46Z</dc:date>
    </item>
  </channel>
</rss>

