<?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: FInd the last updated dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42314#M10997</link>
    <description>Are you looking ofr the last updated dataset or the last dataset that updated the master table?&lt;BR /&gt;
&lt;BR /&gt;
For the first, PROC CONTENTS/MODADTE would be a good solution.&lt;BR /&gt;
You could try also the SYSLAST macro variable which stores the name of the last written dataset.&lt;BR /&gt;
&lt;BR /&gt;
For the last, you could try to arrange your code to save the desired name on some macro variable, for later processing.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
    <pubDate>Tue, 09 Jun 2009 11:45:57 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2009-06-09T11:45:57Z</dc:date>
    <item>
      <title>FInd the last updated dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42312#M10995</link>
      <description>HI&lt;BR /&gt;
&lt;BR /&gt;
i have a master table (master_uniq) consitnously we will updaate dataset to that table (50-120 datasets/perday).Now i want the last updated dataset.i have tryed  dictionary.vtable also.please let me know</description>
      <pubDate>Tue, 09 Jun 2009 06:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42312#M10995</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-09T06:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: FInd the last updated dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42313#M10996</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
You can find this using proc contents.&lt;BR /&gt;
&lt;BR /&gt;
You will have a variable called MODATE which gives you last modified date&lt;BR /&gt;
&lt;BR /&gt;
check with this. &lt;BR /&gt;
&lt;BR /&gt;
Hope this will help you</description>
      <pubDate>Tue, 09 Jun 2009 07:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42313#M10996</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-09T07:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: FInd the last updated dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42314#M10997</link>
      <description>Are you looking ofr the last updated dataset or the last dataset that updated the master table?&lt;BR /&gt;
&lt;BR /&gt;
For the first, PROC CONTENTS/MODADTE would be a good solution.&lt;BR /&gt;
You could try also the SYSLAST macro variable which stores the name of the last written dataset.&lt;BR /&gt;
&lt;BR /&gt;
For the last, you could try to arrange your code to save the desired name on some macro variable, for later processing.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Tue, 09 Jun 2009 11:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42314#M10997</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-06-09T11:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: FInd the last updated dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42315#M10998</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
You can use the following logic to get the last modified date of a file:&lt;BR /&gt;
&lt;BR /&gt;
filename inp pipe "ls -g -o ~/&amp;amp;FileName1";&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  infile inp firstobs=2;&lt;BR /&gt;
  input  @24 ModifiedDate $12. ;&lt;BR /&gt;
  if ModifiedDate=" " then stop; &lt;BR /&gt;
  put ModifiedDate= ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
U can pass the list of all files one by one and record the one with the maximum modified date. &lt;BR /&gt;
Above code is for UNIX,&lt;BR /&gt;
for windows use: filename inf pipe "dir &amp;amp;FileName1 /t:w /a:-d"; and read from the 6th observation&lt;BR /&gt;
in format mmddyy8. and time8.</description>
      <pubDate>Tue, 16 Jun 2009 19:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42315#M10998</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-16T19:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: FInd the last updated dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42316#M10999</link>
      <description>if you update the "master" with PROC APPEND or data step MODIFY, let an AUDIT trail keep the "knowledge".&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
PeterC</description>
      <pubDate>Wed, 17 Jun 2009 06:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FInd-the-last-updated-dataset/m-p/42316#M10999</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-06-17T06:21:25Z</dc:date>
    </item>
  </channel>
</rss>

