<?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: file not found in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635422#M188662</link>
    <description>&lt;P&gt;Did you check to see if the csv file that is created has the proper contents? If it is not created with the proper contents, this could cause the second program to read 0 records.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 19:19:09 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-03-27T19:19:09Z</dc:date>
    <item>
      <title>file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635263#M188605</link>
      <description>&lt;P&gt;I have a sas job that reads a csv and writes out to another csv. Then a second sas job reads this new csv. We have these jobs scheduled to run every 3 hours in windows task scheduler (first one at 10 past the hour and the second one at 15 past). Sometimes the second job does not find the new file even though I can&amp;nbsp;see it in the folder. It seems like windows&amp;nbsp;is not refreshed or something like that. Has anyone experienced this? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 10:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635263#M188605</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T10:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635265#M188606</link>
      <description>&lt;P&gt;Let's start with basic debugging:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you confirmed that the first job has finished writing the CSV before the second job executes? How do you know?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you confirmed that the file name is created properly to be read by the second job?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that isn't it, show us the exact error in the SAS log of the second job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you change the jobs from separated jobs, to one job where the two SAS programs are appended to each other, so the second part can't possibly start running before the first part end. Or better yet, if you can combine the programs, don't write to CSV, save the results of job 1 in a SAS data set and then use that in job 2.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 10:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635265#M188606</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-27T10:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635274#M188609</link>
      <description>&lt;P&gt;Confirmation of completion: dos window closes and sas log shows that job is complete.&lt;/P&gt;
&lt;P&gt;File name is correct. I run the second job again and it finds and processes the file.&lt;/P&gt;
&lt;P&gt;There is no error message,&amp;nbsp;the second job&amp;nbsp;executes a windows dir command and looks for that file and 0 records are returned. When I run the job again it finds the file.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635274#M188609</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T11:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635275#M188610</link>
      <description>&lt;P&gt;What do you mean by "&lt;SPAN&gt;I can&amp;nbsp;see it in the folder"? How do you verify that the file is there? Do you work with shared resources on a network?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway, inspect the timestamp of the file; you might find it was created after the second job started. If you use a scheduler, use conditions to prevent a follow-up job from starting too early.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635275#M188610</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-27T11:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635276#M188611</link>
      <description>&lt;P&gt;we are creating a second file because the original file has carriage returns and line feed that need to be removed.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635276#M188611</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T11:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635277#M188612</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15353"&gt;@p12937&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Confirmation of completion: dos window closes and sas log shows that job is complete.&lt;/P&gt;
&lt;P&gt;File name is correct. I run the second job again and it finds and processes the file.&lt;/P&gt;
&lt;P&gt;There is no error message,&amp;nbsp;the second job&amp;nbsp;executes a windows dir command and looks for that file and 0 records are returned. When I run the job again it finds the file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is there some reason why this has to be two jobs? Could these two programs be run sequentially in a single job? If so, could you use a SAS data set instead of writing a CSV?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635277#M188612</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-27T11:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635289#M188618</link>
      <description>&lt;P&gt;we are creating a second file because the original file has carriage returns and line feeds that need to be removed.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635289#M188618</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T11:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635291#M188620</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15353"&gt;@p12937&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;we are creating a second file because the original file has carriage returns and line feeds that need to be removed.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't see this as a justification for separate programs that launch separately.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635291#M188620</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-27T11:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635296#M188623</link>
      <description>&lt;P&gt;&lt;STRONG&gt;maybe I should try a windows community blog.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 12:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635296#M188623</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T12:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635309#M188627</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15353"&gt;@p12937&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Confirmation of completion: dos window closes and sas log shows that job is complete.&lt;/P&gt;
&lt;P&gt;File name is correct. I run the second job again and it finds and processes the file.&lt;/P&gt;
&lt;P&gt;There is no error message,&amp;nbsp;the second job&amp;nbsp;executes a windows dir command and looks for that file and 0 records are returned. When I run the job again it finds the file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sounds like disk timing issue.&amp;nbsp; The second job is starting before the operating system has finished really writing the file and updating the directory entries.&amp;nbsp; Try just adding a delay between the two steps. If you can edit the SAS code you could either put a sleep() function call at the end of the first one or the start of the second one.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635309#M188627</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-27T13:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635311#M188629</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;There is no error message,&amp;nbsp;the second job&amp;nbsp;executes a windows dir command and looks for that file and 0 records are returned.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Have you checked to see that the first program is actually writing the correct contents to the csv file? If this isn't happening correctly, then the timing isn't the problem. Incorrect contents in the csv file could result in 0 records being read, and no error message might appear.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635311#M188629</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-27T13:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635321#M188631</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 12pt;"&gt;&lt;FONT face="Calibri" color="#000000"&gt;the second job&amp;nbsp;runs 5 minutes&amp;nbsp;after jobs. Is there maybe a windows command that could refresh the directory/cache or something? we are going to try running the windows dir command multiple times&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 14:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635321#M188631</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T14:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635379#M188648</link>
      <description>&lt;P&gt;Have you looked at the timestamps of the files, as suggested? Also look at the timestamps of the log files, as they tell you exactly when the SAS process closed the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have experienced examples of SAS processes doing literally nothing for minutes because of system congestion.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 16:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635379#M188648</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-27T16:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635391#M188655</link>
      <description>&lt;P&gt;yes, I have checked file timestamps, log timestamps and log messages. I really don't think this is a SAS issue, but since I am running SAS programs I thought someone might have had a similar issue with files not being available right away on a&amp;nbsp;windows server or sfa.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 17:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635391#M188655</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2020-03-27T17:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635422#M188662</link>
      <description>&lt;P&gt;Did you check to see if the csv file that is created has the proper contents? If it is not created with the proper contents, this could cause the second program to read 0 records.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 19:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635422#M188662</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-27T19:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: file not found</title>
      <link>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635433#M188666</link>
      <description>&lt;P&gt;Does the first job take longer than 5 minutes?&amp;nbsp; Why not just change the schedule to run them further apart.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 19:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/file-not-found/m-p/635433#M188666</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-27T19:39:25Z</dc:date>
    </item>
  </channel>
</rss>

