<?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 Alert when process failed in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Alert-when-process-failed/m-p/743735#M29258</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I want to generate a alert message when one of my process get failed in base sas.&lt;/P&gt;&lt;P&gt;for example: i run a program to update my database with current records. but it failed.&lt;/P&gt;&lt;P&gt;how i get to know?&lt;/P&gt;</description>
    <pubDate>Wed, 26 May 2021 02:07:09 GMT</pubDate>
    <dc:creator>nilu10686</dc:creator>
    <dc:date>2021-05-26T02:07:09Z</dc:date>
    <item>
      <title>Alert when process failed</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Alert-when-process-failed/m-p/743735#M29258</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I want to generate a alert message when one of my process get failed in base sas.&lt;/P&gt;&lt;P&gt;for example: i run a program to update my database with current records. but it failed.&lt;/P&gt;&lt;P&gt;how i get to know?&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 02:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Alert-when-process-failed/m-p/743735#M29258</guid>
      <dc:creator>nilu10686</dc:creator>
      <dc:date>2021-05-26T02:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Alert when process failed</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Alert-when-process-failed/m-p/743744#M29262</link>
      <description>&lt;P&gt;You can check the macro variable SYSCC.&amp;nbsp; SYSCC is going to capture about 90% of errors.&amp;nbsp; After an SQL call, you can check SQLRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO Check_RC;
    %GLOBAL SQLRC;

    %IF  &amp;amp;SYSCC &amp;gt;= 8 OR
        &amp;amp;SQLRC &amp;gt;= 8 %THEN
        %DO;
            (Send an email here or whatever you think appropriate)
        %END;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You have to declare SQLRC but SYSCC is always present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then after each Data or Proc step you would code the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Check_RC;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, there are a few Errors in SAS that for whatever reason do not get captured in the SYSCC.&amp;nbsp; What I do is look at the SYSERRORTEXT macro variable and compare it to a copy I have saved.&amp;nbsp; If SYSERRORTEXT is not blank and is not equal to the value from the last time I executed %Check_RC, then I also consider that an error even if SYSCC is still zero.&amp;nbsp; A zero return code is considered good.&amp;nbsp; A 4 is considered a warning.&amp;nbsp; An 8 or greater is considered an error.&amp;nbsp; Occasionally there are some values of 1, but those are mostly in another status variable, SYSFILRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 03:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Alert-when-process-failed/m-p/743744#M29262</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-05-26T03:45:25Z</dc:date>
    </item>
  </channel>
</rss>

