<?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: Resource is Write-Locked by another thread in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557992#M155651</link>
    <description>&lt;P&gt;If you write the code directly without any of the macro stuff do you get the same error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;hpsasfin a root of a drive? Any path that does not start with defined root (drive or mount point etc. OS dependent) gets treated as a relative path and can cause some odd errors depending on operating system and how each treats the relative path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And are you running with a SAS server that is actually executing on a different machine? Seriously goes to path issues and permissions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 23:03:19 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-05-10T23:03:19Z</dc:date>
    <item>
      <title>Resource is Write-Locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557847#M155575</link>
      <description>&lt;PRE&gt;ERROR: Resource is write-locked by another thread.  File =/hpsasfin/prod/winfiles13/File.$$1.
Error creating temporary file for XLSX file -&amp;gt; /hpsasfin/prod/winfiles13/File.$$1 .  It is either 
       not an Excel spreadsheet or it is damaged.   Error code=80001019
Requested Output File is Invalid&lt;/PRE&gt;&lt;P&gt;Does anyone know how to get rid of this file so that I can write out to my XLSX file? This happens when I realize that I am exporting the wrong (read, WAY too big) file and stop the process in the middle. I have previously been "solving" this problem by switching the path I export to, but this has happened enough times that I want to know how to solve it so I can write to the same file. Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 15:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557847#M155575</guid>
      <dc:creator>theponcer</dc:creator>
      <dc:date>2019-05-10T15:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Resource is Write-Locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557953#M155624</link>
      <description>&lt;P&gt;Can you share how you are attempting to export the data? A task, wizard, proc export code, ods destination?&lt;/P&gt;
&lt;P&gt;Are you using Display manager, Enterprise Guide, University Edtion? and maybe the OS as well.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557953#M155624</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-10T20:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Resource is Write-Locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557960#M155626</link>
      <description>&lt;P&gt;Operating System: LIN X64 .&lt;/P&gt;&lt;P&gt;Current version: 9.04.01M5P091317&lt;/P&gt;&lt;P&gt;Using EG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro export_excel(table,path,libname,database);
%let libname = %sysfunc(coalescec(&amp;amp;libname,work));
%let database = %sysfunc(coalescec(&amp;amp;database,Excel));

PROC EXPORT  

   DATA=&amp;amp;libname..&amp;amp;table.
   DBMS=&amp;amp;database. REPLACE
   outfile = "&amp;amp;path.";
   sheet= "&amp;amp;table.";
RUN;
%mend;

%let export=/hpsasfin/prod/winfiles13/File.xlsx;

%export_excel(file,&amp;amp;export.,,XLSX);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 20:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557960#M155626</guid>
      <dc:creator>theponcer</dc:creator>
      <dc:date>2019-05-10T20:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Resource is Write-Locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557992#M155651</link>
      <description>&lt;P&gt;If you write the code directly without any of the macro stuff do you get the same error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;hpsasfin a root of a drive? Any path that does not start with defined root (drive or mount point etc. OS dependent) gets treated as a relative path and can cause some odd errors depending on operating system and how each treats the relative path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And are you running with a SAS server that is actually executing on a different machine? Seriously goes to path issues and permissions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 23:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/557992#M155651</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-10T23:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Resource is Write-Locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/558018#M155663</link>
      <description>&lt;P&gt;My guess would be that is has nothing to do with the file path or your way of exporting, but is what it says - a process is still holding the file,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it also happen if you close your EG session and start another? That should close your workspace-server session, but it happens now and then (at least to us) that an orphaned process is left running and holds a file forever, and then you need a system programmer to identify it and kill it. We recently had a situation where we had to reboot the cluster to get a file freed.&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 09:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resource-is-Write-Locked-by-another-thread/m-p/558018#M155663</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-05-11T09:22:35Z</dc:date>
    </item>
  </channel>
</rss>

