<?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 pickup latest available file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559749#M156364</link>
    <description>&lt;P&gt;Hi Friends, i developed below process and just want to make sure have correct logic in place.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goal here is to make sure empty touch file got out ONLY WHEN previous process gets completed and "full/complete" file is available&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step1:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;/*different sas process runs and end of the process one large .dat file out there on sas server */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step2:&lt;/P&gt;&lt;P&gt;/*logic which create touch file only once large .dat file is done writing and fully available*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;%let datfile="/dir-where-dat-file-is/test.dat&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;%if %sysfunc(fileexist(&amp;amp;datfile)) &amp;nbsp;%then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;%do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;infile "cd /dir-where-touch-file-needs-to-go; touch MarketingDataFileReady.txt;" pipe;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 18:30:21 GMT</pubDate>
    <dc:creator>sampsas</dc:creator>
    <dc:date>2019-05-17T18:30:21Z</dc:date>
    <item>
      <title>pickup latest available file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559749#M156364</link>
      <description>&lt;P&gt;Hi Friends, i developed below process and just want to make sure have correct logic in place.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goal here is to make sure empty touch file got out ONLY WHEN previous process gets completed and "full/complete" file is available&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step1:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;/*different sas process runs and end of the process one large .dat file out there on sas server */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step2:&lt;/P&gt;&lt;P&gt;/*logic which create touch file only once large .dat file is done writing and fully available*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;%let datfile="/dir-where-dat-file-is/test.dat&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;%if %sysfunc(fileexist(&amp;amp;datfile)) &amp;nbsp;%then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;%do;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;data _null_;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;infile "cd /dir-where-touch-file-needs-to-go; touch MarketingDataFileReady.txt;" pipe;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 18:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559749#M156364</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-17T18:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: pickup latest available file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559760#M156368</link>
      <description>&lt;P&gt;Seems correct. Other questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Do you remove the .dat file after your touch file is created? It's possible that you may look at the same .dat file multiple times if you don't check timestamps or move the file out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Do you have another process that deletes the touch file later? Same potential issues as question #1.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 19:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559760#M156368</guid>
      <dc:creator>noling</dc:creator>
      <dc:date>2019-05-17T19:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: pickup latest available file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559779#M156374</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Do you remove the .dat file after your touch file is created? &lt;FONT color="#0000FF"&gt;No. this will be replaced/overwritten by my same process next day (process runs on daily bases)&lt;/FONT&gt; It's possible that you may look at the same .dat file multiple times if you don't check timestamps or move the file out.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Do you have another process that deletes the touch file later? &lt;FONT color="#0000FF"&gt;No, this will be replaced/overwritten as well&lt;/FONT&gt;. i am assuming Same potential issues as question #1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;- another technology (non-sas) will pickup touch file&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 20:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pickup-latest-available-file/m-p/559779#M156374</guid>
      <dc:creator>sampsas</dc:creator>
      <dc:date>2019-05-17T20:06:13Z</dc:date>
    </item>
  </channel>
</rss>

