<?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: check if there is a lock on the sas table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869506#M343437</link>
    <description>&lt;P&gt;the SYSLCKRC variable gives me a value greater than zero even keeping the table open. with the lock lib.member list statement I can't "capture" the value obtained in a variable...&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 05:38:27 GMT</pubDate>
    <dc:creator>mariopellegrini</dc:creator>
    <dc:date>2023-04-13T05:38:27Z</dc:date>
    <item>
      <title>check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869412#M343403</link>
      <description>&lt;P&gt;Good morning.&lt;/P&gt;
&lt;P&gt;is there a code to check if there is a lock on a sas table? that is, if it is already open.&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 14:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869412#M343403</guid>
      <dc:creator>mariopellegrini</dc:creator>
      <dc:date>2023-04-12T14:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869418#M343404</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3574"&gt;@mariopellegrini&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This paper has a sample macro that will provide the functionality you are looking for&lt;/P&gt;
&lt;P&gt;&lt;A title="Play Nice with Others: Waiting for a Lock on SAS Table" href="https://www.lexjansen.com/pharmasug/2005/posters/po33.pdf" target="_blank" rel="noopener"&gt;Play Nice with Others: Waiting for a Lock on SAS Table&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 15:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869418#M343404</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-04-12T15:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869426#M343406</link>
      <description>&lt;P&gt;Thanks, but I just need a code to check if a table is locked or not&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 15:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869426#M343406</guid>
      <dc:creator>mariopellegrini</dc:creator>
      <dc:date>2023-04-12T15:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869434#M343408</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3574"&gt;@mariopellegrini&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, but I just need a code to check if a table is locked or not&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The LOCK statement can LIST the status.&lt;/P&gt;
&lt;PRE&gt;lock lib.member list;&lt;/PRE&gt;
&lt;P&gt;will show message in the log similar to:&lt;/P&gt;
&lt;PRE&gt;NOTE: LIB.MEMBER.DATA is not locked or in use by you or any other users.
&lt;/PRE&gt;
&lt;P&gt;or other lock status.&lt;/P&gt;
&lt;P&gt;The Lock statement also sets a value for the system macro variable SYSLCKRC . Automatic macro variable value will be 0 if the last lock statement is successful. &amp;gt;0 if the lock statement is not successful. So one use is to attempt to Lock the file and if it fails, i.e. you can't get a lock, assume it is already locked. Verify the existence of the member first though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember to CLEAR the lock if successful in acquiring the lock.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other behaviors that depend on use of products like SAS/SHARE and I'm not sure about other products.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 16:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869434#M343408</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-12T16:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869437#M343409</link>
      <description>&lt;P&gt;This paper suggests that the LOCK statement isn't necessarily reliable if you don't have SAS/SHARE.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/1465-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/1465-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 16:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869437#M343409</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-04-12T16:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869452#M343410</link>
      <description>&lt;P&gt;If this should be part of an update process, and your SAS runs on UNIX, you can simply delete the dataset file before you write the new dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 18:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869452#M343410</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-12T18:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: check if there is a lock on the sas table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869506#M343437</link>
      <description>&lt;P&gt;the SYSLCKRC variable gives me a value greater than zero even keeping the table open. with the lock lib.member list statement I can't "capture" the value obtained in a variable...&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 05:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-if-there-is-a-lock-on-the-sas-table/m-p/869506#M343437</guid>
      <dc:creator>mariopellegrini</dc:creator>
      <dc:date>2023-04-13T05:38:27Z</dc:date>
    </item>
  </channel>
</rss>

