<?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 Deleting log/print files in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16078#M2886</link>
    <description>I have a SAS programme which I have to submit to a remote site to execute.  In order to preserve my log/print output, I use O/S commands to delete and create them (see below for code).  This has worked fine for several months and continues to work on my test machine.  But, for the past two weeks, the remote site has been unable to delete the log/print files after my programme has completed.  They get an error saying that the file is still in use.  They are storing the files on a network server, not a local machine.&lt;BR /&gt;
&lt;BR /&gt;
Any advice/suggestions would be appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Nick.&lt;BR /&gt;
&lt;BR /&gt;
options noxwait;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  command   =  "rmdir /S /q &amp;amp;location_results";&lt;BR /&gt;
  call system (command);&lt;BR /&gt;
  command1  =  "mkdir &amp;amp;location_results";&lt;BR /&gt;
  call system (command1);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc printto;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename outlog CLEAR;&lt;BR /&gt;
filename outlog "&amp;amp;location_results\log_cohort1_mf.txt";&lt;BR /&gt;
&lt;BR /&gt;
filename outprint CLEAR;&lt;BR /&gt;
filename outprint "&amp;amp;location_results\print_cohort1_mf.txt";&lt;BR /&gt;
&lt;BR /&gt;
proc printto new log=outlog print=outprint;&lt;BR /&gt;
run;</description>
    <pubDate>Fri, 17 Jun 2011 12:32:37 GMT</pubDate>
    <dc:creator>nbirkett</dc:creator>
    <dc:date>2011-06-17T12:32:37Z</dc:date>
    <item>
      <title>Deleting log/print files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16078#M2886</link>
      <description>I have a SAS programme which I have to submit to a remote site to execute.  In order to preserve my log/print output, I use O/S commands to delete and create them (see below for code).  This has worked fine for several months and continues to work on my test machine.  But, for the past two weeks, the remote site has been unable to delete the log/print files after my programme has completed.  They get an error saying that the file is still in use.  They are storing the files on a network server, not a local machine.&lt;BR /&gt;
&lt;BR /&gt;
Any advice/suggestions would be appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Nick.&lt;BR /&gt;
&lt;BR /&gt;
options noxwait;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  command   =  "rmdir /S /q &amp;amp;location_results";&lt;BR /&gt;
  call system (command);&lt;BR /&gt;
  command1  =  "mkdir &amp;amp;location_results";&lt;BR /&gt;
  call system (command1);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc printto;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename outlog CLEAR;&lt;BR /&gt;
filename outlog "&amp;amp;location_results\log_cohort1_mf.txt";&lt;BR /&gt;
&lt;BR /&gt;
filename outprint CLEAR;&lt;BR /&gt;
filename outprint "&amp;amp;location_results\print_cohort1_mf.txt";&lt;BR /&gt;
&lt;BR /&gt;
proc printto new log=outlog print=outprint;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 17 Jun 2011 12:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16078#M2886</guid>
      <dc:creator>nbirkett</dc:creator>
      <dc:date>2011-06-17T12:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting log/print files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16079#M2887</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I don't really understand how "filename outprint CLEAR;" would delete any listing output. Doesn't it just clear the output path for listing output without affecting listing output already created?&lt;BR /&gt;
&lt;BR /&gt;
Another thought: Is there a reason for using "noxwait"? May be running things with options "xwait" and "synch" could resolve the issue. Just thinking that a change in the environment might have slowed down things so that you're now trying to delete stuff before it actually got released - just guessing here.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Fri, 17 Jun 2011 13:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16079#M2887</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-06-17T13:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting log/print files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16080#M2888</link>
      <description>Yes, I agree with you.  The 'filename' was included just to delete the name allocated to the output.  The deletion occurred in the previous code fragment.&lt;BR /&gt;
&lt;BR /&gt;
I will look into the 'noxwait' suggestion.  Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Nick.</description>
      <pubDate>Fri, 17 Jun 2011 14:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-log-print-files/m-p/16080#M2888</guid>
      <dc:creator>nbirkett</dc:creator>
      <dc:date>2011-06-17T14:14:32Z</dc:date>
    </item>
  </channel>
</rss>

