<?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 confusion about &amp;quot;A lock is not available for &amp;lt;dataset&amp;gt;&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805666#M317375</link>
    <description>&lt;P&gt;&lt;STRONG&gt;dear all:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Recently,I was confused about&amp;nbsp;&lt;FONT color="#FF0000"&gt;"A lock is not available for &amp;lt;dataset&amp;gt;"&lt;/FONT&gt;.Indeed ,it's an error,but when I restart SAS and run the code again ,the error disappeared.How to avoid the error?&lt;/P&gt;
&lt;P&gt;When I review my code,I guess 5 possibilities&amp;nbsp; may cause this error， right or wrong？&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*1.set options compress=yes;
options compress=yes;

*2.in data step,input dataset and the output dataset have the same name;
data X;set X ;run;


*3. when using proc sort ,without out= option;
proc sort data=x;by id;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;CODE class=" language-sas"&gt;Any&amp;nbsp;suggestion&amp;nbsp;is&amp;nbsp;welcome!&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Apr 2022 02:03:10 GMT</pubDate>
    <dc:creator>duanzongran</dc:creator>
    <dc:date>2022-04-03T02:03:10Z</dc:date>
    <item>
      <title>confusion about "A lock is not available for &lt;dataset&gt;"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805666#M317375</link>
      <description>&lt;P&gt;&lt;STRONG&gt;dear all:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Recently,I was confused about&amp;nbsp;&lt;FONT color="#FF0000"&gt;"A lock is not available for &amp;lt;dataset&amp;gt;"&lt;/FONT&gt;.Indeed ,it's an error,but when I restart SAS and run the code again ,the error disappeared.How to avoid the error?&lt;/P&gt;
&lt;P&gt;When I review my code,I guess 5 possibilities&amp;nbsp; may cause this error， right or wrong？&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*1.set options compress=yes;
options compress=yes;

*2.in data step,input dataset and the output dataset have the same name;
data X;set X ;run;


*3. when using proc sort ,without out= option;
proc sort data=x;by id;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;CODE class=" language-sas"&gt;Any&amp;nbsp;suggestion&amp;nbsp;is&amp;nbsp;welcome!&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 02:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805666#M317375</guid>
      <dc:creator>duanzongran</dc:creator>
      <dc:date>2022-04-03T02:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: confusion about "A lock is not available for &lt;dataset&gt;"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805670#M317376</link>
      <description>&lt;P&gt;SAS throws this error if a different process locks a table (the SAS file). In your case though the tables are in WORK and that is SAS session specific (=same process).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What can lock a table even in WORK is if you have it already open in your EG session. Below option setting helps to avoid this.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1648951829359.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70061i7E78AFC5CC06811D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1648951829359.png" alt="Patrick_0-1648951829359.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the 3 cases you mention:&lt;/P&gt;
&lt;P&gt;Option compress will never lock a table.&lt;/P&gt;
&lt;P&gt;In your sample code the tables are in WORK which is SAS session (process) specific and no other process (like another SAS session) gets access to this WORK directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 06:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805670#M317376</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-03T06:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: confusion about "A lock is not available for &lt;dataset&gt;"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805691#M317384</link>
      <description>&lt;P&gt;Another thing that can keep a file handle open is anti-virus software which immediately scans all newly created files and prevents an overwrite (or even opens exclusively).&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 09:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/805691#M317384</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-03T09:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: confusion about "A lock is not available for &lt;dataset&gt;"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/818506#M323080</link>
      <description>Yes,quite so   !!!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;After checking my computer ,i found the  anti-virus software  installed by my IT workmate very frequently scan every file I make from sas.&lt;BR /&gt;When I run then code on a computer without the anti-virus software  , it seems everything is OK.</description>
      <pubDate>Thu, 16 Jun 2022 01:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/confusion-about-quot-A-lock-is-not-available-for-lt-dataset-gt/m-p/818506#M323080</guid>
      <dc:creator>duanzongran</dc:creator>
      <dc:date>2022-06-16T01:29:16Z</dc:date>
    </item>
  </channel>
</rss>

