<?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: Supress Errors from the log in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429125#M105980</link>
    <description>&lt;P&gt;There is a NOMSG option for the LOCK statement&amp;nbsp;that seems to do what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryTip"&gt;Tip&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;NOMSG is useful if you want a LOCK statement resubmitted in a code loop until a lock is available, but you do want error messages displayed in the SAS log each time that an exclusive lock is not available.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2018 14:17:33 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2018-01-19T14:17:33Z</dc:date>
    <item>
      <title>Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429123#M105979</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;I am using the below macro to check for a lock every 15 seconds for 30 minutes.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trylock(member=, timeout=);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%local&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; starttime;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; starttime = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(datetime());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%until&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&amp;amp;syslckrc = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;or &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysevalf&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(datetime()) &amp;gt; (&amp;amp;starttime + &amp;amp;timeout)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trying to open ...;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trying lock ...;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lock &amp;amp;member;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;syslckrc ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; rc=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(sleep(15));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; syslckrc=&amp;amp;syslckrc;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trylock;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;if the file is locked the macro will keep running either for 30 minutes or until a lock is available.&amp;nbsp; It will write to the log every time it attempts to lock the file&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;FONT size="3"&gt;Below is an example&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: A lock is not available for &amp;lt;Data&amp;gt;&lt;/P&gt;&lt;P&gt;syslckrc=70031&lt;/P&gt;&lt;P&gt;trying to open ...&lt;/P&gt;&lt;P&gt;trying lock ...&lt;/P&gt;&lt;P&gt;ERROR: A lock is not available for &amp;lt;Data&amp;gt;&lt;/P&gt;&lt;P&gt;syslckrc=70031&lt;/P&gt;&lt;P&gt;trying to open ...&lt;/P&gt;&lt;P&gt;trying lock ...&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp;&amp;lt;Data&amp;gt; &amp;nbsp;is now locked for exclusive access by you.&lt;/P&gt;&lt;P&gt;syslckrc=0&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way I can just get the last entry written to the log rather than all entries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 14:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429123#M105979</guid>
      <dc:creator>DG1984</dc:creator>
      <dc:date>2018-01-19T14:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429125#M105980</link>
      <description>&lt;P&gt;There is a NOMSG option for the LOCK statement&amp;nbsp;that seems to do what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-summaryTip"&gt;Tip&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;NOMSG is useful if you want a LOCK statement resubmitted in a code loop until a lock is available, but you do want error messages displayed in the SAS log each time that an exclusive lock is not available.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 14:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429125#M105980</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2018-01-19T14:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429126#M105981</link>
      <description>&lt;P&gt;Why do you need to do this in the first place.&amp;nbsp; Errors are in the log to tell you something is going wrong, therefore the best solution is to fix what is going wrong.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 14:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429126#M105981</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-19T14:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429168#M105984</link>
      <description>&lt;P&gt;The code is trying to lock a dataset in a loop so it may have errors but eventually it may work, if it does work I don't need to know about the errors which is why I am looking for something that only writes the last try to the log rather all versions.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 15:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429168#M105984</guid>
      <dc:creator>DG1984</dc:creator>
      <dc:date>2018-01-19T15:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429169#M105985</link>
      <description>&lt;P&gt;Thanks will investigate!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 15:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429169#M105985</guid>
      <dc:creator>DG1984</dc:creator>
      <dc:date>2018-01-19T15:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Supress Errors from the log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429365#M106062</link>
      <description>&lt;P&gt;LIBNAME statement has an option FILELOCK something like . Maybe could apply to your scenario .&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2018 10:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Supress-Errors-from-the-log/m-p/429365#M106062</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-20T10:20:26Z</dc:date>
    </item>
  </channel>
</rss>

