<?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: Selecting the last var1 from each distinct var2 in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88774#M879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, thank you very much Linlin. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Oct 2012 11:59:11 GMT</pubDate>
    <dc:creator>TurnTheBacon</dc:creator>
    <dc:date>2012-10-08T11:59:11Z</dc:date>
    <item>
      <title>Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88769#M874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to create a data set that list the last dekning_sk for each distinct avtale_sk from the following source data set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG happy="" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the output data set should say:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="219" style="border: 1px solid #000000; width: 103px; height: 81px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Avtale_sk&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Dekning_sk&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;145&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;122&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;145&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;122&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;122&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;12&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;118&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;167&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;167&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of user written code would produce this kind of result? Either DATA STEP or PROC SQL would be fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time. &lt;SPAN __jive_emoticon_name="_happy.gif'"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88769#M874</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-10-08T11:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88770#M875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by avtale_sk dekning_sk notsorted;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last.dekning_sk;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88770#M875</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-10-08T11:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88771#M876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion, but as far as I can tell the output data set looks exactly the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88771#M876</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-10-08T11:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88772#M877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you get 121 when &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;avtale_sk&lt;/SPAN&gt;=3 ? why not 122?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try the modified one:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by avtale_sk notsorted;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if last.avtale_sk;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88772#M877</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-10-08T11:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88773#M878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm very sorry, that was a typo. I should have been more vigilant. It's been corrected now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88773#M878</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-10-08T11:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting the last var1 from each distinct var2</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88774#M879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, thank you very much Linlin. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 11:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Selecting-the-last-var1-from-each-distinct-var2/m-p/88774#M879</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-10-08T11:59:11Z</dc:date>
    </item>
  </channel>
</rss>

