<?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 %trylock and Error condition: full message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73341#M15782</link>
    <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I have to implement concurrent write access to a SAS table (control table) without SAS\Share (not licensed) – SAS9.2 under UNIX.&lt;BR /&gt;
&lt;BR /&gt;
I have in principal a working solution based on the %trylock macro as documented under &lt;A href="http://www.lexjansen.com/pharmasug/2005/posters/po33.pdf" target="_blank"&gt;http://www.lexjansen.com/pharmasug/2005/posters/po33.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
My problem is:&lt;BR /&gt;
In case the table is locked the macro throws an error. Also that execution goes on and everything works I can’t accept Error messages in the log nor a job to end different than with an Error condition of zero.&lt;BR /&gt;
&lt;BR /&gt;
I can’t figure out how to achieve this suppression of Errors – especially the ones written to the log.&lt;BR /&gt;
I could save the error status at the beginning of the macro and re-set it at the very end of the macro – but what should I do with the log?&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions would be really welcome (it starts to drive me nuts)!&lt;BR /&gt;
&lt;BR /&gt;
The way I test the macro is to open 2 SAS session. In the first one I open the table used for testing (sashelp.class), in the second session I call the macro as below (and then I go back to the first session and close the table).&lt;BR /&gt;
&lt;BR /&gt;
%macro trylock(member=,timeout=10,retry=1);&lt;BR /&gt;
  %local starttime;&lt;BR /&gt;
  %let starttime = %sysfunc(datetime());&lt;BR /&gt;
  %do %until(&amp;amp;syslckrc LE 0&lt;BR /&gt;
    or %sysevalf(%sysfunc(datetime()) GT (&amp;amp;starttime + &amp;amp;timeout)));&lt;BR /&gt;
    %put trying open ...;&lt;BR /&gt;
    data _null_;&lt;BR /&gt;
      dsid = 0;&lt;BR /&gt;
      do until (dsid GT 0 or datetime() GT (&amp;amp;starttime + &amp;amp;timeout));&lt;BR /&gt;
        dsid = open("&amp;amp;member");&lt;BR /&gt;
        if (dsid = 0) then rc = sleep(&amp;amp;retry);&lt;BR /&gt;
      end;&lt;BR /&gt;
      if (dsid GT 0) then rc = close(dsid);&lt;BR /&gt;
    run;&lt;BR /&gt;
    %put trying lock ...;&lt;BR /&gt;
    lock &amp;amp;member;&lt;BR /&gt;
    %put syslckrc=&amp;amp;syslckrc;&lt;BR /&gt;
  %end;&lt;BR /&gt;
%mend trylock;&lt;BR /&gt;
&lt;BR /&gt;
%trylock(member=sashelp.class,timeout=60,retry=5);&lt;BR /&gt;
&lt;BR /&gt;
lock sashelp.class clear;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The macro as given above is exactly what has been published in the link given.&lt;BR /&gt;
&lt;BR /&gt;
The error I'm getting if a table is locked:&lt;BR /&gt;
&lt;BR /&gt;
trying lock ...&lt;BR /&gt;
ERROR: A lock is not available for SASHELP.CLASS.DATA.&lt;BR /&gt;
syslckrc=70031&lt;BR /&gt;
&lt;BR /&gt;
As soon as I unlock the table in my other SAS session the following happens:&lt;BR /&gt;
&lt;BR /&gt;
trying lock ...&lt;BR /&gt;
NOTE: SASHELP.CLASS.DATA is now locked for exclusive access by you.&lt;BR /&gt;
syslckrc=0&lt;BR /&gt;
36         &lt;BR /&gt;
37         lock sashelp.class clear;&lt;BR /&gt;
NOTE: SASHELP.CLASS.DATA is no longer locked by you.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
So as already described: The macro works as such but I end up with Errors which shouldn't be there.&lt;BR /&gt;
It's the LOCK statement causing the issues and I still haven't found a way to capture the error conditions.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Patrick

Message was edited by: Patrick</description>
    <pubDate>Sun, 19 Sep 2010 14:56:02 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2010-09-19T14:56:02Z</dc:date>
    <item>
      <title>%trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73341#M15782</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I have to implement concurrent write access to a SAS table (control table) without SAS\Share (not licensed) – SAS9.2 under UNIX.&lt;BR /&gt;
&lt;BR /&gt;
I have in principal a working solution based on the %trylock macro as documented under &lt;A href="http://www.lexjansen.com/pharmasug/2005/posters/po33.pdf" target="_blank"&gt;http://www.lexjansen.com/pharmasug/2005/posters/po33.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
My problem is:&lt;BR /&gt;
In case the table is locked the macro throws an error. Also that execution goes on and everything works I can’t accept Error messages in the log nor a job to end different than with an Error condition of zero.&lt;BR /&gt;
&lt;BR /&gt;
I can’t figure out how to achieve this suppression of Errors – especially the ones written to the log.&lt;BR /&gt;
I could save the error status at the beginning of the macro and re-set it at the very end of the macro – but what should I do with the log?&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions would be really welcome (it starts to drive me nuts)!&lt;BR /&gt;
&lt;BR /&gt;
The way I test the macro is to open 2 SAS session. In the first one I open the table used for testing (sashelp.class), in the second session I call the macro as below (and then I go back to the first session and close the table).&lt;BR /&gt;
&lt;BR /&gt;
%macro trylock(member=,timeout=10,retry=1);&lt;BR /&gt;
  %local starttime;&lt;BR /&gt;
  %let starttime = %sysfunc(datetime());&lt;BR /&gt;
  %do %until(&amp;amp;syslckrc LE 0&lt;BR /&gt;
    or %sysevalf(%sysfunc(datetime()) GT (&amp;amp;starttime + &amp;amp;timeout)));&lt;BR /&gt;
    %put trying open ...;&lt;BR /&gt;
    data _null_;&lt;BR /&gt;
      dsid = 0;&lt;BR /&gt;
      do until (dsid GT 0 or datetime() GT (&amp;amp;starttime + &amp;amp;timeout));&lt;BR /&gt;
        dsid = open("&amp;amp;member");&lt;BR /&gt;
        if (dsid = 0) then rc = sleep(&amp;amp;retry);&lt;BR /&gt;
      end;&lt;BR /&gt;
      if (dsid GT 0) then rc = close(dsid);&lt;BR /&gt;
    run;&lt;BR /&gt;
    %put trying lock ...;&lt;BR /&gt;
    lock &amp;amp;member;&lt;BR /&gt;
    %put syslckrc=&amp;amp;syslckrc;&lt;BR /&gt;
  %end;&lt;BR /&gt;
%mend trylock;&lt;BR /&gt;
&lt;BR /&gt;
%trylock(member=sashelp.class,timeout=60,retry=5);&lt;BR /&gt;
&lt;BR /&gt;
lock sashelp.class clear;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The macro as given above is exactly what has been published in the link given.&lt;BR /&gt;
&lt;BR /&gt;
The error I'm getting if a table is locked:&lt;BR /&gt;
&lt;BR /&gt;
trying lock ...&lt;BR /&gt;
ERROR: A lock is not available for SASHELP.CLASS.DATA.&lt;BR /&gt;
syslckrc=70031&lt;BR /&gt;
&lt;BR /&gt;
As soon as I unlock the table in my other SAS session the following happens:&lt;BR /&gt;
&lt;BR /&gt;
trying lock ...&lt;BR /&gt;
NOTE: SASHELP.CLASS.DATA is now locked for exclusive access by you.&lt;BR /&gt;
syslckrc=0&lt;BR /&gt;
36         &lt;BR /&gt;
37         lock sashelp.class clear;&lt;BR /&gt;
NOTE: SASHELP.CLASS.DATA is no longer locked by you.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
So as already described: The macro works as such but I end up with Errors which shouldn't be there.&lt;BR /&gt;
It's the LOCK statement causing the issues and I still haven't found a way to capture the error conditions.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Patrick

Message was edited by: Patrick</description>
      <pubDate>Sun, 19 Sep 2010 14:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73341#M15782</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-19T14:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73342#M15783</link>
      <description>Exactly what SAS error are you getting in your log?  Preferably share the SAS code in your SASLOG output, pasted as a post-reply with all code exposed, otherwise we are left guessing about the error you are concerned about.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sun, 19 Sep 2010 15:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73342#M15783</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-19T15:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73343#M15784</link>
      <description>Patrick&lt;BR /&gt;
some of your macro is not appearing on the forum because the syntax uses less-than or greater-than symbols - normally reserved for "forum-markup". If you replace the symbols as suggested in that in a posting I can't find right now, with &amp;amp; LT; or just use the mnemonic LT for &amp;lt; etc. then we would be more able to see what is in your macro  &lt;BR /&gt;
It is hard work deciphering it from the "Quote Original" version that follows .&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; %macro trylock(member=,timeout=10,retry=1);&lt;BR /&gt;
&amp;gt;   %local starttime;&lt;BR /&gt;
&amp;gt; %let starttime = %sysfunc(datetime());&lt;BR /&gt;
&amp;gt;   %do %until(&amp;amp;syslckrc &amp;lt;= 0&lt;BR /&gt;
&amp;gt; or %sysevalf(%sysfunc(datetime()) &amp;gt; (&amp;amp;starttime +&lt;BR /&gt;
&amp;gt; &amp;amp;timeout)));&lt;BR /&gt;
&amp;gt;     %put trying open ...;&lt;BR /&gt;
&amp;gt; data _null_;&lt;BR /&gt;
&amp;gt;       dsid = 0;&lt;BR /&gt;
&amp;gt; do until (dsid &amp;gt; 0 or datetime() &amp;gt; (&amp;amp;starttime +&lt;BR /&gt;
&amp;gt; &amp;amp;timeout));&lt;BR /&gt;
&amp;gt;         dsid = open("&amp;amp;member");&lt;BR /&gt;
&amp;gt; if (dsid = 0) then rc = sleep(&amp;amp;retry);&lt;BR /&gt;
&amp;gt;       end;&lt;BR /&gt;
&amp;gt; if (dsid &amp;gt; 0) then rc = close(dsid);&lt;BR /&gt;
&amp;gt;     run;&lt;BR /&gt;
&amp;gt; %put trying lock ...;&lt;BR /&gt;
&amp;gt;     lock &amp;amp;member;&lt;BR /&gt;
&amp;gt; %put syslckrc=&amp;amp;syslckrc;&lt;BR /&gt;
&amp;gt;   %end;&lt;BR /&gt;
&amp;gt; end trylock;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; %trylock(member=sashelp.class,timeout=60,retry=5);&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; lock sashelp.class clear;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
peterC</description>
      <pubDate>Sun, 19 Sep 2010 17:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73343#M15784</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-09-19T17:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73344#M15785</link>
      <description>Peter:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Use the [pre] and [/pre] tags around your code and output in order to maintain indenting and spacing. Use &amp;amp;lt; for &amp;lt; and &amp;amp;gt; for &amp;gt; symbols...&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Sun, 19 Sep 2010 17:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73344#M15785</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-19T17:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73345#M15786</link>
      <description>Thank You Cynthia&lt;BR /&gt;
that link is now added to the top of my favourites &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
 &lt;BR /&gt;
peter</description>
      <pubDate>Sun, 19 Sep 2010 17:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73345#M15786</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-09-19T17:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73346#M15787</link>
      <description>The program works as I expect it to, which may be a bit odd.   If the program times out waiting for a lock then it still executes the LOCK statement, which I don't think you want.  If you want a different action just modify it to maybe, print a message and ENDSAS when it times out.</description>
      <pubDate>Mon, 20 Sep 2010 14:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73346#M15787</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-09-20T14:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73347#M15788</link>
      <description>Hi data _null_&lt;BR /&gt;
&lt;BR /&gt;
I want the macro to try and lock the table - and if not successful to wait a defined time and then try again to lock the table - until either the total time for trials runs out or a lock is successful.&lt;BR /&gt;
&lt;BR /&gt;
My "only" problem is that if the lock is not successful a error message is written to the log and I haven't found a way to suppress this. &lt;BR /&gt;
&lt;BR /&gt;
No error condition (code) is generated in 'my' UNIX environment so the issue is at least only on the level of 'ugly'.&lt;BR /&gt;
&lt;BR /&gt;
To be more precise: &amp;amp;syscc is not affected and stays 0 but somewhere the error condition must be saved as in the end of the log the errors are mentioned.&lt;BR /&gt;
&lt;BR /&gt;
What I'm looking for is to suppress the log error message caused by an unsuccessful lock statement and not to write it to the log. It would already be o.k. if I could suppress any log messages while the macro executes and not to mention any errors in the end of the log.&lt;BR /&gt;
&lt;BR /&gt;
Interesting is also that if I use 'lock &lt;DATA set=""&gt; list; in a Win32 environment then the log tells me that no one is locking the DS (even though I have it open in a second EG session), but when I submit a 'lock &lt;DATA set=""&gt;;' I'm getting the all to well known error message.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Patrick&lt;/DATA&gt;&lt;/DATA&gt;</description>
      <pubDate>Wed, 22 Sep 2010 12:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73347#M15788</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-22T12:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73348#M15789</link>
      <description>&amp;gt; Hi data _null_&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I want the macro to try and lock the table - and if&lt;BR /&gt;
&amp;gt; not successful to wait a defined time and then try&lt;BR /&gt;
&amp;gt; again to lock the table - until either the total time&lt;BR /&gt;
&amp;gt; for trials runs out or a lock is successful.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; My "only" problem is that if the lock is not&lt;BR /&gt;
&amp;gt; successful a error message is written to the log and&lt;BR /&gt;
&amp;gt; I haven't found a way to suppress this. &lt;BR /&gt;
&lt;BR /&gt;
The macro is designed to use OPEN to TEST if a LOCK can be obtained.  If a lock can be obtain by sucessfully opening the data set or the loop times out the lock is attempted. This is a flaw in the code in my opinion.  I think you should modify the code to NOT attempt the lock if the loop times out.  You know you can't get a lock so why try.   This will fix the ERROR problem.  Then you can take action as needed because you can't get the LOCK within the time limit.</description>
      <pubDate>Wed, 22 Sep 2010 15:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73348#M15789</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-09-22T15:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73349#M15790</link>
      <description>Ok, forget that.  &lt;BR /&gt;
&lt;BR /&gt;
I don't think OPEN will work I think you will need FOPEN in Update mode.&lt;BR /&gt;
&lt;BR /&gt;
My testing shows that if the data set is open in say EG then OPEN will not show that.  However if you create a FILEREF that points to the data set and use &lt;BR /&gt;
[pre]FOPEN(fileref,'U')[/pre]&lt;BR /&gt;
the function will return "file in use" and you can determine if a LOCK would fail or not.</description>
      <pubDate>Wed, 22 Sep 2010 18:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73349#M15790</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-09-22T18:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73350#M15791</link>
      <description>Hi data _null_&lt;BR /&gt;
&lt;BR /&gt;
I made the same observation with OPEN. Kind of weird.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the tip with FOPEN. I'll try this.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Patrick</description>
      <pubDate>Fri, 24 Sep 2010 08:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73350#M15791</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-24T08:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73351#M15792</link>
      <description>if (dsid = 0) then rc = sleep(&amp;amp;retry);&lt;BR /&gt;
end;&lt;BR /&gt;
if (dsid GT 0) then rc = close(dsid);&lt;BR /&gt;
run;&lt;BR /&gt;
%put trying lock ...;&lt;BR /&gt;
lock &amp;amp;member;&lt;BR /&gt;
%put syslckrc=&amp;amp;syslckrc;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend trylock;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.kintek.com.au/"&gt;Web Design Brisbane&lt;/A&gt;</description>
      <pubDate>Fri, 24 Sep 2010 17:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73351#M15792</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-24T17:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73352#M15793</link>
      <description>Sam&lt;BR /&gt;
&lt;BR /&gt;
I believe part of your post got "truncated".&lt;BR /&gt;
&lt;BR /&gt;
From what I see: One of the issues is that OPEN returns a value NE 0 even if the table is opened in a second EG session.&lt;BR /&gt;
&lt;BR /&gt;
That's why data _null_ suggested to use FOPEN.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Patrick</description>
      <pubDate>Sat, 25 Sep 2010 00:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73352#M15793</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-25T00:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73353#M15794</link>
      <description>FOPEN() did the job.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again data _null_&lt;BR /&gt;
&lt;BR /&gt;
If anybody is interested in my version of the %trylock macro please let me know and I post it here (still finalising it).</description>
      <pubDate>Wed, 29 Sep 2010 12:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73353#M15794</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-29T12:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73354#M15795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please post your tested version for %trylock macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in adavnce.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 21:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73354#M15795</guid>
      <dc:creator>jeeth79usa</dc:creator>
      <dc:date>2013-07-15T21:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73355#M15796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeeth&lt;/P&gt;&lt;P&gt;That's now almost 3 years ago...&lt;/P&gt;&lt;P&gt;What I remember is that even after implementing all the good stuff data null suggested I still found cases during testing where the macro didn't behave as required. I ended up with running the jobs in sequence and "flagged" %trylock as an approach I'm no more trying to use in the future.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jul 2013 00:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/73355#M15796</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-07-21T00:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/238234#M43751</link>
      <description>&lt;P&gt;Try using ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lock &amp;amp;member NOMSG;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;errors are suppressed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 09:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/238234#M43751</guid>
      <dc:creator>Kanchan</dc:creator>
      <dc:date>2015-12-08T09:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: %trylock and Error condition: full message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/335249#M75858</link>
      <description>&lt;P&gt;This "&lt;SPAN&gt;NOMSG&lt;/SPAN&gt;" solved my problem, i was having erros on trying to lock the table while the table was still locked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it's the full code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Options to help debug the macro */&lt;BR /&gt;options mprint mlogic symbolgen;&lt;/P&gt;&lt;P&gt;%macro trylock(member=, timeout=);&lt;BR /&gt;%local starttime;&lt;BR /&gt;%let starttime = %sysfunc(datetime());&lt;BR /&gt;%do %until (&amp;amp;syslckrc = 0&lt;BR /&gt;or %sysevalf(%sysfunc(datetime()) &amp;gt; (&amp;amp;starttime + &amp;amp;timeout)));&lt;BR /&gt;%put trying to open ...;&lt;BR /&gt;%put trying lock ...;&lt;BR /&gt;lock &amp;amp;member NOMSG;&lt;BR /&gt;%if &amp;amp;syslckrc ne 0 %then %let rc=%sysfunc(sleep(15));&lt;BR /&gt;%put syslckrc=&amp;amp;syslckrc;&lt;BR /&gt;%end;&lt;BR /&gt;%mend trylock;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%trylock(member=&amp;amp;TABLE, timeout=&amp;amp;TIME_TO_CHECK);&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trylock-and-Error-condition-full-message/m-p/335249#M75858</guid>
      <dc:creator>LG86</dc:creator>
      <dc:date>2017-02-23T11:38:03Z</dc:date>
    </item>
  </channel>
</rss>

