<?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: pick Latest timestamp in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682165#M24088</link>
    <description>&lt;P&gt;No format means that this can only be a character variable (look at the&amp;nbsp;&lt;EM&gt;type&lt;/EM&gt;).&lt;/P&gt;
&lt;P&gt;Dates or times as character are mostly useless in SAS. Convert this to SAS datetime values first, ideally in the step that gets the data into SAS in the first place.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 08:18:09 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-09-08T08:18:09Z</dc:date>
    <item>
      <title>pick Latest timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682149#M24082</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;The code below helps me to pick the last timestamp&amp;nbsp; record &lt;STRONG&gt;whereas i want the latest one.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;An account A1 have 2 email ids E1 with Timestamp 12/20/2020 12 :30:00&amp;nbsp;and E2&amp;nbsp;with Timestamp 09/02/2020&amp;nbsp;12 :10:00 then it should pick the E1 record but in my code it will pick E2 as it is the last one.&amp;nbsp;&lt;BR /&gt;Please highlight the changes I need to do in below code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*****************************************************************************************************************&lt;/P&gt;&lt;P&gt;libname rpl "/stage_1/download/backup/adhoc/kyccrs/083020/bestbuy_dcfaccess_weekly";&lt;BR /&gt;options obs = max yearcutoff=1940;&lt;/P&gt;&lt;P&gt;%macro a;&lt;BR /&gt;(KEEP = WS_ACCT_NUM WS_EMAIL_ADDR_LAST WS_EMAIL_ADDR)&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;data rpl_dcf;&lt;BR /&gt;set rpl.bbrdcf_eaddr083020;&lt;BR /&gt;set rpl.bbrdcf_eaddrpii083020;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Proc sort data =rpl_dcf;&lt;BR /&gt;by WS_ACCT_NUM WS_EMAIL_ADDR_LAST ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* using last account that is sorted by account &amp;amp; timestamp. */&lt;/P&gt;&lt;P&gt;data all;&lt;BR /&gt;set rpl_dcf;&lt;BR /&gt;by WS_ACCT_NUM;&lt;BR /&gt;if last.WS_ACCT_NUM ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Proc sort data =all;&lt;BR /&gt;by WS_ACCT_NUM WS_EMAIL_ADDR_LAST ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all;&lt;BR /&gt;RETAIN WS_ACCT_NUM WS_EMAIL_ADDR_LAST WS_EMAIL_ADDR ;&lt;BR /&gt;set all %a;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc export data = all&lt;BR /&gt;outfile="/etl/home/rrtqarun/data/aml/Datasets/cardholder/dataset_frequency/trial083020.csv"&lt;BR /&gt;dbms=csv&lt;BR /&gt;replace;&lt;BR /&gt;delimiter= '|';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;*****************************************************************************************************************&lt;/P&gt;&lt;P&gt;help will be appreciated&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 07:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682149#M24082</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2020-09-08T07:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: pick Latest timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682152#M24083</link>
      <description>&lt;P&gt;This can only happen if your timestamps are stored in character variables and not as SAS datetime values.&lt;/P&gt;
&lt;P&gt;Maxim 3: Know Your Data. Run a PROC CONTENTS on the dataset and inspect the attributes of your timestamp variable.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 07:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682152#M24083</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-08T07:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: pick Latest timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682163#M24086</link>
      <description>thank you for these solutions .&lt;BR /&gt;This is the only issue content file for this dataset is showing format blank.</description>
      <pubDate>Tue, 08 Sep 2020 08:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682163#M24086</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2020-09-08T08:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: pick Latest timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682165#M24088</link>
      <description>&lt;P&gt;No format means that this can only be a character variable (look at the&amp;nbsp;&lt;EM&gt;type&lt;/EM&gt;).&lt;/P&gt;
&lt;P&gt;Dates or times as character are mostly useless in SAS. Convert this to SAS datetime values first, ideally in the step that gets the data into SAS in the first place.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 08:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/pick-Latest-timestamp/m-p/682165#M24088</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-08T08:18:09Z</dc:date>
    </item>
  </channel>
</rss>

