<?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: A lock is not available for a table. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164276#M42608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are right.&amp;nbsp; The code works after I move&lt;/P&gt;&lt;P&gt;CREATE TABLE sourcing_chart_name10_stad (chart_name char(30)) ;&lt;/P&gt;&lt;P&gt;onto the top of all codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later run&lt;/P&gt;&lt;P&gt; INSERT INTO sourcing_chart_name10_stad VALUES('ABC_Plant') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may end up some timing issue if putting these two executions close to each other. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Sep 2014 18:42:24 GMT</pubDate>
    <dc:creator>wutao9999</dc:creator>
    <dc:date>2014-09-29T18:42:24Z</dc:date>
    <item>
      <title>Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164269#M42601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a code that sometimes works and sometimes doesn't work, which bothers me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt; CREATE TABLE sourcing_chart_name10_stad (chart_name char(30)) ;&lt;/P&gt;&lt;P&gt; INSERT INTO sourcing_chart_name10_stad VALUES('ABC_Plant') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;ERROR: A lock is not available for WORK.SOURCING_CHART_NAME10_STAD.DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is dropped after each run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code sometimes works, but doesn't work in other times.&amp;nbsp; I don't understand why the code does not always work.&amp;nbsp; What could be the reason?&amp;nbsp; Thank you for the help.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164269#M42601</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2014-09-29T15:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164270#M42602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is probably what is described in the error message: some other process has a lock on the dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's rare to get this error with a&amp;nbsp; work dataset, however, as typically only one SAS session would write to a work library at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to replicate your error message when I start 2 SAS sessions running on my PC, and have both sessions trying to write to the dataset at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps virus scanning or similar could be accidentally locking a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 17:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164270#M42602</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-09-29T17:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164271#M42603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you get the error after the create table or the insert into statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 17:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164271#M42603</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-09-29T17:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164272#M42604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that:&amp;nbsp; There is only one process in running.&amp;nbsp; I am sure there is no other people running the code at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The weird thing is that:&amp;nbsp; at one time, I run the code, it works.&amp;nbsp; Then, run another time, it doesn't work, then run another time, it works again.&amp;nbsp; It seems that the code works 80% times when I run, but fails 20% times when I run it.&amp;nbsp; Either work or fail does happen randomly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible the code "INSERT INTO sourcing_chart_name10_stad VALUES('ABC_Plant') ;" sometimes executes even before when the code "CREATE TABLE sourcing_chart_name10_stad (chart_name char(30)) ;" is completely done?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 17:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164272#M42604</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2014-09-29T17:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164273#M42605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the error after the insert into statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 17:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164273#M42605</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2014-09-29T17:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164274#M42606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using&lt;/P&gt;&lt;P&gt;-&amp;nbsp; SQL, The language is designed for record retrieval and modification in an OLTP approach&lt;/P&gt;&lt;P&gt;-&amp;nbsp; proc sql, that procedure is multi-threading, several processes may run in parallel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You re not running one process when possible it will start several threads for you.&lt;/P&gt;&lt;P&gt;Updating the same table that is also being retrieved was once possible (8.2) after that it got into an error (9 multi-threading).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As you create the table and immediately wanting an update(lock required) you can have run into timing issues.&amp;nbsp; &lt;/P&gt;&lt;P&gt;That can be SAS internal or on the OS system whoever verifies the lock is still there.&lt;/P&gt;&lt;P&gt;The syntax is correct an I am convinced it should be handled correctly the timing should be solved internal. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164274#M42606</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-29T18:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164275#M42607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way to avoid locking would be to use a DATA step instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 9pt; background: white; font-family: Consolas;"&gt;data &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;sourcing_chart_name10_stad;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;&lt;SPAN style="color: #575757; font-family: Arial; font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;attrib &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;chart_name &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt; = $&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 9pt; background: white; font-family: Consolas;"&gt;30&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;chart_name = &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: Consolas; font-size: 9pt;"&gt;'ABC_Plant'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: Consolas; font-size: 9pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 9pt; background: white; font-family: Consolas;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: Consolas; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164275#M42607</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2014-09-29T18:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error: A lock is not available for a table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164276#M42608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are right.&amp;nbsp; The code works after I move&lt;/P&gt;&lt;P&gt;CREATE TABLE sourcing_chart_name10_stad (chart_name char(30)) ;&lt;/P&gt;&lt;P&gt;onto the top of all codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later run&lt;/P&gt;&lt;P&gt; INSERT INTO sourcing_chart_name10_stad VALUES('ABC_Plant') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may end up some timing issue if putting these two executions close to each other. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-A-lock-is-not-available-for-a-table/m-p/164276#M42608</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2014-09-29T18:42:24Z</dc:date>
    </item>
  </channel>
</rss>

