<?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: Ignoring certain SAS Warnings in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500814#M133406</link>
    <description>&lt;P&gt;Thank you. Yea, Given that I know now that the missing value was causing the issue, I should have wrote a conditional if statement to have the substr calculate only on populated values.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 15:39:19 GMT</pubDate>
    <dc:creator>BhararaTej</dc:creator>
    <dc:date>2018-10-02T15:39:19Z</dc:date>
    <item>
      <title>Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500764#M133392</link>
      <description>&lt;P&gt;I am running a program which is scheduled through the SAS Management Console and usually I get email notifications if the program ran successfully (Done Status) or did it Exit (meaning SAS says it had some issues). These email triggers are auto generated through the Management Console.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, one of my programs is generating an Exit Status because of below 2 lines. But these are not actually errors, but just warnings and the program is fine. I am trying to figure out if there is a way for me to have SAS suppress/ ignore certain type of these warnings, so that I can have Management console generate a Success Status notification and not Exit.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Invalid third argument to function SUBSTR at line 554 column 12.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Tb&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500764#M133392</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2018-10-02T14:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500784#M133396</link>
      <description>&lt;P&gt;Fix your code.&amp;nbsp; There is a reason why warnings and errors come out in the log.&amp;nbsp; In this example you have a substr() call with either a missing third value, or a value which is too long for the text string.&amp;nbsp; This would be an error and may affect results, hence its a very good idea to fix it.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500784#M133396</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-02T14:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500787#M133397</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the substrn function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002255112.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002255112.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quote :&lt;/P&gt;
&lt;P&gt;The following information applies to the SUBSTRN function:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A name="a002896275" target="_blank"&gt;&lt;/A&gt; The SUBSTRN function returns a string with a length of zero if either &lt;SPAN class="emph"&gt;position&lt;/SPAN&gt; or &lt;SPAN class="emph"&gt;length&lt;/SPAN&gt; has a missing value.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A name="a002896276" target="_blank"&gt;&lt;/A&gt; If the position that you specify is non-positive, the result is truncated at the beginning, so that the first character of the result is the first character of the string. The length of the result is reduced accordingly.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;A name="a002896277" target="_blank"&gt;&lt;/A&gt; If the length that you specify extends beyond the end of the string, the result is truncated at the end, so that the last character of the result is the last character of the string.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500787#M133397</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-10-02T14:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500788#M133398</link>
      <description>&lt;P&gt;I would say that is an error.&amp;nbsp; It's just unfortunate that SAS writes a NOTE: to the log rather than an ERROR: message.&amp;nbsp; This is one of many notes that are really errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, first question would be what value is causing the problem fro SUBSTR()?&amp;nbsp; Note that there is a SUBSTRN() function which will accept some arguments that are invalid arguments for SUBSTR().&amp;nbsp; For example, if the third argument is longer than the length of the first argument, SUBSTRN() will truncate it rather than throw an error.&amp;nbsp; Depending on the cause of your problem, SUBSTRN() might let you handle more cases without generating an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set sashelp.class ;
  x=substr(name,1,20) ;  *throws error;
  y=substrn(name,1,20) ;  *works without error;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No, I don't think there is an easy way to specify this specific error should not trigger an Exit status.&amp;nbsp; There are options for handling errors, and you can force a successful return status, but generally you don't have the granularity to limit which specific problems effect the return status.&amp;nbsp; I think it will be easier to avoid the error by adapting your code to prevent it from occurring.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500788#M133398</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2018-10-02T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500795#M133399</link>
      <description>&lt;P&gt;You may need to run the substr on condition to avoid warnings for the records that don't meet the substr criteria.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to ignore that notes then set &lt;STRONG&gt;OPTIONS ERRORS=0;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500795#M133399</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-10-02T15:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500808#M133404</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110221"&gt;@BhararaTej&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am running a program which is scheduled through the SAS Management Console and usually I get email notifications if the program ran successfully (Done Status) or did it Exit (meaning SAS says it had some issues). These email triggers are auto generated through the Management Console.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, one of my programs is generating an Exit Status because of below 2 lines. But these are not actually errors, but just warnings and the program is fine. I am trying to figure out if there is a way for me to have SAS suppress/ ignore certain type of these warnings, so that I can have Management console generate a Success Status notification and not Exit.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Invalid third argument to function SUBSTR at line 554 column 12.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Tb&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you suppress those errors how will you know when you actually have an error or incorrect parameter passed? If there's something in the data where that shouldn't be calculated wrap that calculation in an IF statement so it's conditional. A clean log is a good practice.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500808#M133404</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-02T15:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500813#M133405</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value that is causing the issue is 'missing' and the substrn is able to handle that without generating any kind of note or warning in the log.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500813#M133405</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2018-10-02T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Ignoring certain SAS Warnings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500814#M133406</link>
      <description>&lt;P&gt;Thank you. Yea, Given that I know now that the missing value was causing the issue, I should have wrote a conditional if statement to have the substr calculate only on populated values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignoring-certain-SAS-Warnings/m-p/500814#M133406</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2018-10-02T15:39:19Z</dc:date>
    </item>
  </channel>
</rss>

