<?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: SAS Email if Errors in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19093#M3826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our solution is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- all SAS batch jobs MUST exit with return code zero if they finish "logically OK". This of course requires solid coding&lt;/P&gt;&lt;P&gt;- there is a sas batch wrapper script that is called by the scheduler, pertinent information is passed via environment variables&lt;/P&gt;&lt;P&gt;- if the SAS execution itself finishes with zero, the log is checked (via grep) for the existence of certain words/phrases that indicate faulty execution that did not trigger a SAS exit code &amp;lt;&amp;gt; 0 (for instance there are certain conditions that can happen when FTPing from z/OS, or a single line of faulty data in an infile). Such phrases may cause (limited) reruns and/or the setting of special exit codes.&lt;/P&gt;&lt;P&gt;- if after all that the exit code is &amp;lt;&amp;gt; 0, the log is displayed to stdout, which the scheduler captures to its own log&lt;/P&gt;&lt;P&gt;- some programs send email (if execution was successful) on their own via the server OS sendmail, and of course the scheduler has "send mail" options (and will always do so in case of a nonzero exit code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2014 09:04:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2014-05-21T09:04:27Z</dc:date>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19079#M3812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if there is any code I can use / incorporate into my sas program which will email me at a specific email address if errors occur or if the program fails?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 15:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19079#M3812</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-03-01T15:34:33Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19080#M3813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;filename mailbox email &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'xxxxx@xxxx.com"&gt;'xxxxx@xxxx.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;subject = 'test';&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set table;&lt;/P&gt;&lt;P&gt;if &amp;lt;condition&amp;gt; then put "error";&lt;/P&gt;&lt;P&gt;call sleep(1,1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** this code will prevent you running the code further in case if the condition fails **;&lt;/P&gt;&lt;P&gt;data table2;&lt;/P&gt;&lt;P&gt;set table;&lt;/P&gt;&lt;P&gt;if &amp;lt;condition&amp;gt; then abort abend 123;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 15:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19080#M3813</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-03-01T15:59:03Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19081#M3814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if I use this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;SPAN&gt;filename mailbox email &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'xxx@xxx.com"&gt;'xxx@xxx.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;subject = 'test';&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;data _null_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;set table;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;if &amp;lt;condition&amp;gt; then put "error";&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;call sleep(1,1);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;run;&lt;/P&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will email me if any errors occur? and if I replace the data part with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;** this code will prevent you running the code further in case if the condition fails **;&lt;/P&gt;&lt;P&gt;data table2;&lt;/P&gt;&lt;P&gt;set table;&lt;/P&gt;&lt;P&gt;if &amp;lt;condition&amp;gt; then abort abend 123;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;Then it will email and stop program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19081#M3814</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-03-01T16:06:40Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19082#M3815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. The below code is works as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input col1 col2 col3;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;2 3 5&lt;/P&gt;&lt;P&gt;3 4 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;condition= col1+col2 = column3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will receive an email with subject = test and message as error. Are you looking for email if there is error in sas log?&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;filename mailbox email &lt;A class="jive-link-email-small" href="mailto:%27xxx@xxx.com"&gt;'xxx@xxx.com&lt;/A&gt;'&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;subject = 'test';&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;data _null_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;set table;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;if&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;col1+col2 ne column3&lt;/SPAN&gt;&amp;nbsp; &lt;/STRONG&gt;then put "error";&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;call sleep(1,1);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;run;&lt;/P&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19082#M3815</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-03-01T16:13:20Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19083#M3816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to receive an email if an error occurs in SAS log, please gp through the link below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www2.sas.com/proceedings/sugi31/128-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/128-31.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19083#M3816</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-03-01T16:14:08Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19084#M3817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I am looking for this type of functionalty. It seems like the PDF explains a way to check a log file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any ways this can occur within the SAS program? So as soon as an error shows up in the run process...sas emails and notifies?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19084#M3817</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-03-01T16:20:01Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19085#M3818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you probably have to have code check points. I normally know where errors might occur in the code and I create check points. Below is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input col1 col2 col3;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;2 3 5&lt;/P&gt;&lt;P&gt;3 4 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;condition= col1+col2 = column3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;filename mailbox email &lt;A class="jive-link-email-small" href="mailto:%27xxx@xxx.com"&gt;'xxx@xxx.com&lt;/A&gt;'&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;subject = 'test';&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;data _null_;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;set table;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;if&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;col1+col2 ne column3&lt;/SPAN&gt;&amp;nbsp; &lt;/STRONG&gt;then put "error";&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;call sleep(1,1);&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; font-family: Arial,Helvetica,sans-serif;"&gt;run;&lt;/P&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19085#M3818</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-03-01T16:24:04Z</dc:date>
    </item>
    <item>
      <title>SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19086#M3819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is easy to do if you put the code in a macro and use a %if on the system error code to determine whether or not to send the email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have time to write it this morning as I'm in the middle of preparing a paper for SGF.&amp;nbsp; However, that paper includes a section that does something similar (sort of) in that it checks whether a date is a holiday and, if it is, sends an email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll paste that macro here, but you would have to modify it yourself.&amp;nbsp; Obviously, you don't want to use it, as is, as it sends a picture of a menorah:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro sendit(to,subj,from,test=NO);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if &amp;amp;test. eq YES %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let today=%sysevalf("12DEC2012"d);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else %let today=%sysfunc(today());&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %sysfunc(intindex(JewishHolidays,&amp;amp;today.)) %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; options EMAILSYS=SMTP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILID="your_email_address"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILPW="your_email_password"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILHOST="your_email_smtp_address"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILAUTHPROTOCOL=LOGIN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILPORT=587 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Note: EMAILPORT may have to set to 25 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename mymail email lrecl=256 TYPE='TEXT/HTML';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file mymail to=("&amp;amp;to.") subject="&amp;amp;subj.";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array candles[17] $40. (17*'&amp;nbsp;');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;B&amp;gt;&amp;lt;font face='courier new'&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=intindex('JewishHolidays',&amp;amp;today.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=cat('Hope you have a Happy ',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; propcase(strip(put(x,s2jhol.))),'!');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt; &amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if put(x,s2jhol.) eq 'HANUKKAH' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ncandles=2*(&amp;amp;today.-intnx('JewishHolidays',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;today.,0))+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ncandles gt 7 then ncandles+2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candles[9]=")";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles:));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;font face='courier new' color=red&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to ncandles by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candles&lt;I&gt;=")";&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i eq 7 then i=9;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;font face='courier new' color=red&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles1-candles8));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;font face='courier new' color=black&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put %quote(candles(9));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;font face='courier new' color=red&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles10-candles17));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 17 by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candles&lt;I&gt;="|";&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles:));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;font face='courier new' color=black&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=2 to 16 by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candles&lt;I&gt;="_";&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles:));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 17;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i eq 8 then i=11;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; candles&lt;I&gt;='&amp;nbsp;';&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=catx(' ',of %quote(candles:));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg "&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;BR&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "&amp;amp;from";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '&amp;lt;/style&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Example usage */&lt;/P&gt;&lt;P&gt;%sendit(EmailAddress,Happy Holidays,YourName,test=YES) /* If only testing */&lt;/P&gt;&lt;P&gt;%sendit(EmailAddress,Happy Holidays,YourName) /* Actual use */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:31:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19086#M3819</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-01T16:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19087#M3820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Really neat!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to work with this but if someone has a working sample they use, please do share &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 16:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19087#M3820</guid>
      <dc:creator>vomer</dc:creator>
      <dc:date>2012-03-01T16:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19088#M3821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just ran across the following sample code for sending an automatic email if an error/warning is encountered: &lt;A href="http://support.sas.com/kb/36/567.html"&gt;http://support.sas.com/kb/36/567.html&lt;/A&gt;. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 15:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19088#M3821</guid>
      <dc:creator>Michelle</dc:creator>
      <dc:date>2014-05-20T15:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19089#M3822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michelle just a question: What will be the result if all processing has stopped for a reason?&lt;BR /&gt;Thinking the other way could be better. The signalling of an "ok" processing is more certain event. That is functionality in schedulers, when something should be finished but is not in time that is the signal.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 17:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19089#M3822</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-05-20T17:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19090#M3823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point! However, I want to receive the error/warning email because sometimes the program runs and spits out results even though something may have gone wrong somewhere.&amp;nbsp; So, maybe it is better to apply both approaches and have an 'ok' email, in addition to the 'error' email. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 21:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19090#M3823</guid>
      <dc:creator>Michelle</dc:creator>
      <dc:date>2014-05-20T21:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19091#M3824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point Michelle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you have 3 different programs that you expect to run successfully every night.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recently I've been playing with an approach that is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; When each program runs, at the end of the program it calls a %logscan() macro which checks the log for any errors/warnings/bad notes.&amp;nbsp; It then appends a single record to a "joblog" dataset which has: ProgramName, RunDate, LogCheckResult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Then there is a separate program scheduled to run nightly which looks at the data in the joblogdataset.&amp;nbsp; It expects to find records in the joblog dataset for ProgramA, ProgramB, and ProgramC all run within the past 24 hours, and expects the LogChekResult to be "Pass" for each job.&amp;nbsp; It sends me a single email every night, which says "Nightly check passed" or "Nightly check failed" (because I job had a bad log or a job did not run), with the body of the email listing the jobs that have run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 22:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19091#M3824</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-05-20T22:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19092#M3825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is leaving the last question. Why should you build/develop something that is already solved and part of a service.&lt;BR /&gt;- Schedulers for organizing jobs/processes with feedback&lt;/P&gt;&lt;P&gt;- error detection and messaging with the SAS environment it self.&lt;BR /&gt;Sometimes you are needing to learn some basics or the question and solution is that simple there is no need for additional investments.&lt;BR /&gt;As soon as you are going to develop a whole complicated dedicated system, normally it is: reuse something already existing, buy before build.&lt;BR /&gt;I know building it yourself is that nice, but is it always necessary?&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 05:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19092#M3825</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-05-21T05:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19093#M3826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our solution is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- all SAS batch jobs MUST exit with return code zero if they finish "logically OK". This of course requires solid coding&lt;/P&gt;&lt;P&gt;- there is a sas batch wrapper script that is called by the scheduler, pertinent information is passed via environment variables&lt;/P&gt;&lt;P&gt;- if the SAS execution itself finishes with zero, the log is checked (via grep) for the existence of certain words/phrases that indicate faulty execution that did not trigger a SAS exit code &amp;lt;&amp;gt; 0 (for instance there are certain conditions that can happen when FTPing from z/OS, or a single line of faulty data in an infile). Such phrases may cause (limited) reruns and/or the setting of special exit codes.&lt;/P&gt;&lt;P&gt;- if after all that the exit code is &amp;lt;&amp;gt; 0, the log is displayed to stdout, which the scheduler captures to its own log&lt;/P&gt;&lt;P&gt;- some programs send email (if execution was successful) on their own via the server OS sendmail, and of course the scheduler has "send mail" options (and will always do so in case of a nonzero exit code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 09:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19093#M3826</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-21T09:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19094#M3827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Jaap,&lt;/P&gt;&lt;P&gt;In the case of log checking, many folks have been using customized %logcheck() macros since long before the more recent SAS supplied logging model.&amp;nbsp; Thus this qualifies as "reuse," particularly when the macros are part of a shared enterprise macro library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was inspired to work on one after seeing:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nesug.org/proceedings/nesug01/cc/cc4008.pdf"&gt;http://www.nesug.org/proceedings/nesug01/cc/cc4008.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As pointed out in the paper, developing your own log scanning algorithm allows you to decide what is worthy of considering a bad log message.&amp;nbsp;&amp;nbsp; There are many notes that people treat as errors.&amp;nbsp; The authors argue that the most conservative approach for log scanning is to provide a white list of accepted log NOTES, and treat any other message as an ERROR:.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Kurt points out (and I did not mention), this customized log scanning/emailing does not preclude one from using the error notification features present in the scheduler or other parts of the SAS environment, and often they complement each other.&amp;nbsp; The pograms I described are all scheduled through LSF using SMC, and the job metadata defines whether SAS will send job completion emails, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19094#M3827</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-05-21T10:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19095#M3828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes quentin, I know you have a different background as to the one I have. &lt;BR /&gt;I am seeing a lot happening with assumptions of people not really cooperative with their IT staff.&lt;/P&gt;&lt;P&gt;As have being also part of IT, I am seeing that form an other perspective. So we are discussing again.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Nesug has stopped papers can be found at lexjanssen. This one is 2001 based section codes-corner.&lt;/P&gt;&lt;P&gt;Year 2001, I'll go back to 1980's. Scheduling was to be introduced yet at IT (ca-7 ucc7 ctl-d opc a lot of the same). &lt;/P&gt;&lt;P&gt;A lot of resistance by the operators ("bridge") and the operations-support department. They did it always manually and were thinking doing it better and cheaper. Do a guess on the outcome.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;So we are 30 years later now and what kind of discussions we are in?&amp;nbsp; The planning and monitoring done by business users at the same level as those old days by operators.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19095#M3828</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-05-21T10:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19096#M3829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jaap, but you are mistaken to think that the approach I described briefly is necessarily a personal approach developed/owned by individual users/operators rather than an enterprise solution managed by SAS admins / IT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use of SAS Autocall facility is an excellent tool for enterprise-wide standardization, and provides flexibility (when desired) to allow standardization at various levels (enterprise/server/project/etc.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An enterprise %logcheck() macro provides opportunities for the same error detection algorithm to be used in a variety of environments (old fashioned interactive DM SAS, batch jobs, DI jobs, EG... ).&amp;nbsp; The log scanning can happen in "real time", or after-the-fact (given a directory full of logs, scan them all).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not too surprisingly, when I look into the code for a DIS job that has been deployed for scheduling via SMC, what do I see at the end in the code generated by SAS?&amp;nbsp; A macro for checking return codes and emailing:&lt;/P&gt;&lt;PRE&gt;%macro etls_jobRCChk; 
&amp;nbsp;&amp;nbsp; %if (&amp;amp;job_rc ge 5) %then
&amp;nbsp;&amp;nbsp; %do; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro etls_sendEmail(address=, message=); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename sendMail email "&amp;amp;address" subject='ETL Process Status'; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %local etls_syntaxcheck; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let etls_syntaxcheck = %sysfunc(getoption(syntaxcheck)); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Turn off syntaxcheck option to perform following steps&amp;nbsp; */ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options nosyntaxcheck;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file sendMail; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dttm = put(datetime(),nldatm.); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put dttm "&amp;amp;message."; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Reset syntaxcheck option to previous setting&amp;nbsp; */ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options &amp;amp;etls_syntaxcheck; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend etls_sendEmail; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %etls_sendEmail 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (address = &lt;A href="mailto:me@myhouse.com"&gt;me@myhouse.com&lt;/A&gt;, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message = Error); 
&amp;nbsp;&amp;nbsp; %end; 
%mend etls_jobRCChk; 
%etls_jobRCChk; 
&lt;/PRE&gt;&lt;P&gt;I would prefer it if SAS provided these macros in the autocall library, to make it easier for an enterprise to customize these routines according to their own needs.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 12:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19096#M3829</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-05-21T12:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19097#M3830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well Quentin we are that close together and still living in different worlds.&lt;BR /&gt;I would like to support autocall-macros when needed and if needed that is not a SAS-institute task, there we are different, but your internal IT-staff support. I did this kind of stuff and I know the challenges around that. I hope you understand hosting and multi-tenancy. With that you can see what is to be done around that.&lt;BR /&gt;Your sample with DI that is given I would advice not to use. Finding some different way to solve requirements.&lt;BR /&gt;What is the reason? (rhetoric)&lt;/P&gt;&lt;P&gt;I am seeing something that is environment dependent. Mail-addresses, User-ids, passwords, physical file names, DBMS connection should not get part of the generated code. That is some classic coding standards to get that reliable in a release-management. Adjusting code in an operational production environment is just "not done".&lt;BR /&gt;I have seen SAS has documented that as the solutions to solve those kind of issues. That is as bad way and should be killed.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;There are policies guidelines to follow coming in at an other level. I am sorry that the IT world is little bit more as just SAS.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 13:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19097#M3830</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-05-21T13:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email if Errors</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19098#M3831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, at least we can agree that there are several deficiencies in the generated %etls_jobRCchk macro that I posted, starting with nesting the defintion of %etls_sendEmail within it. : )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 15:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Email-if-Errors/m-p/19098#M3831</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-05-21T15:12:29Z</dc:date>
    </item>
  </channel>
</rss>

