<?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: Lock available for SAS table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71682#M15518</link>
    <description>You may want to experiment with using LIBNAME / FILENAME and interrogating automatic variables SYSFILRC or SYSLIBRC.  Also the parameter WAIT=nn and the SAS OPTIONS FILEMSGS may influence SAS behavior when unsuccessful.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 29 Jan 2009 20:09:19 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-01-29T20:09:19Z</dc:date>
    <item>
      <title>Lock available for SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71679#M15515</link>
      <description>Hi everyone,&lt;BR /&gt;
Does anybody know a convenient way to find out if I can get an exclusive lock on table, before a batch job is launched? We are using 9.1.3, and both Base and SPDE. Since SPDE apparently doesn't support the LOCK statement, and the OPEN function just open tables in input mode, I don't know what to do.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Linus</description>
      <pubDate>Thu, 29 Jan 2009 14:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71679#M15515</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-29T14:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lock available for SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71680#M15516</link>
      <description>Here is an example out of a system I am writing.  It keeps trying every few seconds until it is free.&lt;BR /&gt;
 &lt;BR /&gt;
%macro update_year( fiscyear);&lt;BR /&gt;
    %if (&amp;amp;syserr =  %sysrc(_sok)) %then %do;&lt;BR /&gt;
    %put &amp;amp;sysrc ;&lt;BR /&gt;
    %TRYAGAIN:&lt;BR /&gt;
      lock currbw.br_years;&lt;BR /&gt;
%put &amp;amp;syslckrc;&lt;BR /&gt;
      %if (&amp;amp;SYSLCKRC ne  %sysrc(_sok)) %then %do;&lt;BR /&gt;
        %let rc = %sysfunc(sleep(20000));&lt;BR /&gt;
&lt;BR /&gt;
        %goto TRYAGAIN;&lt;BR /&gt;
      %end;&lt;BR /&gt;
      %else %do;&lt;BR /&gt;
         CALL YOUR EXECUTION HERE;&lt;BR /&gt;
      %end;&lt;BR /&gt;
      lock currbw.br_years  clear;&lt;BR /&gt;
   %end;&lt;BR /&gt;
   %else %put Status file not updated for FY &amp;amp;fiscyear because errcode was &amp;amp;syserr ;&lt;BR /&gt;
   %mend;</description>
      <pubDate>Thu, 29 Jan 2009 14:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71680#M15516</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-01-29T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lock available for SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71681#M15517</link>
      <description>Thanks for your quick response. But SPDE does not support the LOCK statement unfortunately, so I need something else for those libraries.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 29 Jan 2009 14:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71681#M15517</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-29T14:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lock available for SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71682#M15518</link>
      <description>You may want to experiment with using LIBNAME / FILENAME and interrogating automatic variables SYSFILRC or SYSLIBRC.  Also the parameter WAIT=nn and the SAS OPTIONS FILEMSGS may influence SAS behavior when unsuccessful.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 29 Jan 2009 20:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71682#M15518</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-01-29T20:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lock available for SAS table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71683#M15519</link>
      <description>Since our concern is locking on individual objects, I don't think SYSLIBRC will be useful, neither SYSFILRC (which tells whether a physical location/file exists or not). I might be helped with FILEMSGS in some way, but unfortunately we are in UNIX (Solaris), not z/os. I'm not sure how I am intend to use WAIT in this situation.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Fri, 30 Jan 2009 08:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lock-available-for-SAS-table/m-p/71683#M15519</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-30T08:08:40Z</dc:date>
    </item>
  </channel>
</rss>

