<?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 SAS Email options in Management Console in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Email-options-in-Management-Console/m-p/502324#M134081</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need one help. I have written one piece of code where based on certain conditions, SAS shoots an email to users notifying an event. For example, if there is a file missing or count of records zero in a file. The issue is when I run the code in SAS EG, it shoots an email with email sent log, but when I schedule the same code in SAS Management Console&amp;nbsp;it does not send the email.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not face any issue running the code manually in SAS EG, however while scheduling it does not send the email. Do I need to&amp;nbsp;activate some additional settings in Management Console to enable in sending email? What can be the&amp;nbsp; reason for it? Let me know if you need more information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the sample macro which I execute in the main body of the code and also invoke it&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%MACRO countobs (outtablename,filename );&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select count(*) into: chk&lt;BR /&gt;from &amp;amp;outtablename.;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;%PUT &amp;amp;chk ;&lt;/P&gt;&lt;P&gt;%IF &amp;amp;chk LE 0 %THEN %DO ;&lt;BR /&gt;options emailsys =smtp&lt;BR /&gt;emailhost=smtp.&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;&lt;BR /&gt;emailid="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;"&lt;BR /&gt;emailpw="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;"&lt;BR /&gt;emailauthprotocol=login;&lt;BR /&gt;filename myemail EMAIL&lt;BR /&gt;to="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;"&lt;BR /&gt;cc=("&lt;SPAN&gt;#######&lt;/SPAN&gt;@#######.com" "&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;" "&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;")&lt;BR /&gt;subject= "&amp;amp;filename. is blank for &amp;amp;filename_dt. ";&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;BR /&gt;FILE myemail;&lt;BR /&gt;PUT "Hello";&lt;BR /&gt;PUT "&amp;amp;filename. is blank for &amp;amp;filename_dt. and SAS session will be aborted";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PUT "Please note this is an automatic email sent from the system due to zero records in the &amp;amp;filename. file today";&lt;BR /&gt;RUN;&lt;BR /&gt;%abort cancel;&lt;BR /&gt;%end ;&lt;/P&gt;&lt;P&gt;%MEND countobs ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%countobs(&amp;amp;outtablename,&amp;amp;file_name);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 08:15:50 GMT</pubDate>
    <dc:creator>sameer112217</dc:creator>
    <dc:date>2018-10-08T08:15:50Z</dc:date>
    <item>
      <title>SAS Email options in Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Email-options-in-Management-Console/m-p/502324#M134081</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need one help. I have written one piece of code where based on certain conditions, SAS shoots an email to users notifying an event. For example, if there is a file missing or count of records zero in a file. The issue is when I run the code in SAS EG, it shoots an email with email sent log, but when I schedule the same code in SAS Management Console&amp;nbsp;it does not send the email.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not face any issue running the code manually in SAS EG, however while scheduling it does not send the email. Do I need to&amp;nbsp;activate some additional settings in Management Console to enable in sending email? What can be the&amp;nbsp; reason for it? Let me know if you need more information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the sample macro which I execute in the main body of the code and also invoke it&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%MACRO countobs (outtablename,filename );&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select count(*) into: chk&lt;BR /&gt;from &amp;amp;outtablename.;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;%PUT &amp;amp;chk ;&lt;/P&gt;&lt;P&gt;%IF &amp;amp;chk LE 0 %THEN %DO ;&lt;BR /&gt;options emailsys =smtp&lt;BR /&gt;emailhost=smtp.&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;&lt;BR /&gt;emailid="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;"&lt;BR /&gt;emailpw="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;"&lt;BR /&gt;emailauthprotocol=login;&lt;BR /&gt;filename myemail EMAIL&lt;BR /&gt;to="&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;"&lt;BR /&gt;cc=("&lt;SPAN&gt;#######&lt;/SPAN&gt;@#######.com" "&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;" "&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;#######&lt;/SPAN&gt;&lt;SPAN&gt;.com&lt;/SPAN&gt;")&lt;BR /&gt;subject= "&amp;amp;filename. is blank for &amp;amp;filename_dt. ";&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;BR /&gt;FILE myemail;&lt;BR /&gt;PUT "Hello";&lt;BR /&gt;PUT "&amp;amp;filename. is blank for &amp;amp;filename_dt. and SAS session will be aborted";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PUT "Please note this is an automatic email sent from the system due to zero records in the &amp;amp;filename. file today";&lt;BR /&gt;RUN;&lt;BR /&gt;%abort cancel;&lt;BR /&gt;%end ;&lt;/P&gt;&lt;P&gt;%MEND countobs ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%countobs(&amp;amp;outtablename,&amp;amp;file_name);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 08:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Email-options-in-Management-Console/m-p/502324#M134081</guid>
      <dc:creator>sameer112217</dc:creator>
      <dc:date>2018-10-08T08:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Email options in Management Console</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Email-options-in-Management-Console/m-p/503382#M134500</link>
      <description>&lt;P&gt;Do you have a SAS log for the scheduled job where the e-mail isn't sent?&amp;nbsp; A successful run would show something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NOTE: The file MSG is:
      E-Mail Access Device

Message sent
      To:          "recipient@company.com"
      Cc:          
      Bcc:         
      Subject:    your subject line
      Attachments: &lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Oct 2018 12:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Email-options-in-Management-Console/m-p/503382#M134500</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-10-11T12:41:18Z</dc:date>
    </item>
  </channel>
</rss>

