<?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: Output records to dataset based on timestamp and id variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535275#M33047</link>
    <description>Sort ascending or descending and use FIRST or LAST respectively to get the first or last record for each ID. &lt;BR /&gt;&lt;BR /&gt;proc sort data=have;&lt;BR /&gt;by ID time_stamp;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by id time_stamp;&lt;BR /&gt;if last.id;&lt;BR /&gt;run;</description>
    <pubDate>Wed, 13 Feb 2019 16:39:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-02-13T16:39:09Z</dc:date>
    <item>
      <title>Output records to dataset based on timestamp and id variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535271#M33046</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset of transactions for people and I need to identify which ones are the latest. I have a timestamp variable which we can call time_stamp and I have an ID variable which we call ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timestamp is numeric with larger values meaning its more recent to the system.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I did to run some code that outputs the latest value for an individual when the timestamp is the largest for that id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone supply and ideas please?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 16:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535271#M33046</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2019-02-13T16:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Output records to dataset based on timestamp and id variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535275#M33047</link>
      <description>Sort ascending or descending and use FIRST or LAST respectively to get the first or last record for each ID. &lt;BR /&gt;&lt;BR /&gt;proc sort data=have;&lt;BR /&gt;by ID time_stamp;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by id time_stamp;&lt;BR /&gt;if last.id;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 13 Feb 2019 16:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535275#M33047</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-13T16:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Output records to dataset based on timestamp and id variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535277#M33048</link>
      <description>Or use the MAX() function in SQL or PROC MEANS.</description>
      <pubDate>Wed, 13 Feb 2019 16:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Output-records-to-dataset-based-on-timestamp-and-id-variable/m-p/535277#M33048</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-13T16:39:25Z</dc:date>
    </item>
  </channel>
</rss>

