<?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: ERROR: Resource is write-locked by another thread in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895014#M353556</link>
    <description>&lt;P&gt;hanks. I will try that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, to provide more details I add the extended log, as the error is persisting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I see the error triggered on the 15/09, and there was no other version of the code running in parallel on that day, I can also exclude that the error is generated by a parallel session running. so no idea at all why this is happening.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;MPRINT(PROCHTTP_CHECK_RETURN):   filename src temp;
MPRINT(PROCHTTP_CHECK_RETURN):   proc http url="vle.sas.com/mod/page/view.php?id=139728" out=src;
MPRINT(PROCHTTP_CHECK_RETURN):   run;

ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
NOTE: 200 OK
ERROR: Generic HTTP Client Error
NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.22 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              487.37k
      OS Memory           579068.00k
      Timestamp           09/15/2023 07:31:55 PM
      Step Count                        3758064  Switch Count  0
      Page Faults                       0
      Page Reclaims                     68
      Page Swaps                        0
      Voluntary Context Switches        13
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      
NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Sep 2023 09:36:03 GMT</pubDate>
    <dc:creator>dcortell</dc:creator>
    <dc:date>2023-09-20T09:36:03Z</dc:date>
    <item>
      <title>ERROR: Resource is write-locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/892601#M352543</link>
      <description>&lt;P&gt;Dear experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code iteratively scraping a list of URLs using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;MPRINT(PROCHTTP_CHECK_RETURN):   filename src temp;
MPRINT(PROCHTTP_CHECK_RETURN):   proc http url="communities.sas.com/t5/forums/recentpostspage/user-id/407567" out=src;
MPRINT(PROCHTTP_CHECK_RETURN):   run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get during the execution the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_work2268000075CE_miseiddvp1/#LN00021.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is any way I can work to ensure that the write-locking of the file do not persist?&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>Mon, 04 Sep 2023 17:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/892601#M352543</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-09-04T17:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Resource is write-locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/893701#M353053</link>
      <description>&lt;P&gt;I tried your code in SAS Studio, and did not get any errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure, but one explanation that you get this error could be that PROC HTTP tries to run several threads - if that's the case, you could try using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;option nothreads;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in your macro before calling PROC HTTP.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 06:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/893701#M353053</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-09-12T06:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Resource is write-locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895014#M353556</link>
      <description>&lt;P&gt;hanks. I will try that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, to provide more details I add the extended log, as the error is persisting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I see the error triggered on the 15/09, and there was no other version of the code running in parallel on that day, I can also exclude that the error is generated by a parallel session running. so no idea at all why this is happening.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;MPRINT(PROCHTTP_CHECK_RETURN):   filename src temp;
MPRINT(PROCHTTP_CHECK_RETURN):   proc http url="vle.sas.com/mod/page/view.php?id=139728" out=src;
MPRINT(PROCHTTP_CHECK_RETURN):   run;

ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: Resource is write-locked by another thread.  File =/batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
ERROR: File is in use, /batchtmp/SAS_workB9F50001F7E4_miseiddvp1/#LN00021.
NOTE: 200 OK
ERROR: Generic HTTP Client Error
NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.22 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              487.37k
      OS Memory           579068.00k
      Timestamp           09/15/2023 07:31:55 PM
      Step Count                        3758064  Switch Count  0
      Page Faults                       0
      Page Reclaims                     68
      Page Swaps                        0
      Voluntary Context Switches        13
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           0
      
NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2023 09:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895014#M353556</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-09-20T09:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Resource is write-locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895015#M353557</link>
      <description>&lt;P&gt;I think it's not the "threads" option:&lt;/P&gt;
&lt;PRE&gt;1    options threads;
2    filename src temp;
3    proc http url="communities.sas.com/t5/forums/recentpostspage/user-id/407567" out=src;
4    run;

NOTE: 200 OK
NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.74 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;I would rather consider network issue (maybe VPN is blocking access).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try filename URL approach too:&lt;/P&gt;
&lt;PRE&gt;1
2    filename src temp lrecl=1 recfm=n;;
3    filename in URL "https://communities.sas.com/t5/forums/recentpostspage/user-id/407567" lrecl=1 recfm=n;
4
5    data _null_;
6      rc = fcopy("in", "src");
7      rctxt = sysmsg();
8      if rc then put rctxt ;
9    run;

NOTE: DATA statement used (Total process time):
      real time           10.40 seconds
      cpu time            0.28 seconds
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 10:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895015#M353557</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-09-20T10:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Resource is write-locked by another thread</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895076#M353585</link>
      <description>&lt;P&gt;Partial code is such a pain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are "iteratively scraping " where are you CLEARING the filename SRC assignment?&lt;/P&gt;
&lt;P&gt;I suspect that you need a&lt;/P&gt;
&lt;PRE&gt;Filename SRC CLEAR;&lt;/PRE&gt;
&lt;P&gt;before attempting the subsequent "iteration". But where it may go can't tell.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 15:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Resource-is-write-locked-by-another-thread/m-p/895076#M353585</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-20T15:12:19Z</dc:date>
    </item>
  </channel>
</rss>

