<?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: Email Automation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723173#M224364</link>
    <description>After some more tinkering I figured out the issue.&lt;BR /&gt;&lt;BR /&gt;For me to include the REPORT_DT variable I need to use double quotes in the Subject Line&lt;BR /&gt;&lt;BR /&gt;filename mymail email to=('email@email.ca')&lt;BR /&gt;subject= "Report for the week of &amp;amp;REPORT_DT."&lt;BR /&gt;attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");</description>
    <pubDate>Wed, 03 Mar 2021 15:26:43 GMT</pubDate>
    <dc:creator>Jyuen204</dc:creator>
    <dc:date>2021-03-03T15:26:43Z</dc:date>
    <item>
      <title>Email Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723140#M224350</link>
      <description>&lt;P&gt;I have a piece of code that exports and emails the file to a distribution list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let subject =&amp;nbsp; Report for the week of &amp;amp;REPORT_DT.;&lt;BR /&gt;filename mymail email to=('EMAIL@EMAIL.CA')&lt;BR /&gt;subject=%bquote(&amp;amp;subject.)&lt;BR /&gt;attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");&lt;BR /&gt;&lt;BR /&gt;REPORT_DT is just an address created for the reporting data to stamp within the subject line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However this generates an error when I run this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I ran it like below it works but I cannot use the REPORT_DT to timestamp the subject line&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;filename mymail email to=('EMAIL@EMAIL.CA')&lt;BR /&gt;subject='TEST Promo Report'&lt;BR /&gt;attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 13:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723140#M224350</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2021-03-03T13:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Email Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723152#M224354</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;It would be helpful if you provided the log with the following macro options turned on&lt;BR /&gt;&lt;BR /&gt;options mprint symbolgen ;&lt;BR /&gt;&lt;BR /&gt;At a guess you have some kind of macro variable resolution issue, and I would start with trying this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen ;
%put Report Date : &amp;amp;Report_DT
%let subject =  Report for the week of &amp;amp;REPORT_DT.;
%put Subject: &amp;amp;subject ;
filename mymail email to=('EMAIL@EMAIL.CA')
subject="Report for the week of &amp;amp;REPORT_DT." ;
attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 14:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723152#M224354</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-03-03T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Email Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723154#M224355</link>
      <description>29         options mprint symbolgen ;&lt;BR /&gt;SYMBOLGEN:  Macro variable REPORT_DT resolves to Sunday, February 21, 2021&lt;BR /&gt;30         %let subject = BI9161 GCPromo Report for the week of &amp;amp;REPORT_DT.;&lt;BR /&gt;31         filename mymail email to=('jason.yuen@bellmts.ca')&lt;BR /&gt;32         subject=%bquote(&amp;amp;subject.)&lt;BR /&gt;SYMBOLGEN:  Macro variable SUBJECT resolves to BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;NOTE: Line generated by the macro function "BQUOTE".&lt;BR /&gt;32         BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                  _______&lt;BR /&gt;                  23&lt;BR /&gt;ERROR 23-2: Invalid option name GCPromo.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                           ______&lt;BR /&gt;                           23&lt;BR /&gt;ERROR 23-2: Invalid option name Report.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                  ___&lt;BR /&gt;                                  23&lt;BR /&gt;ERROR 23-2: Invalid option name for.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                      ___&lt;BR /&gt;                                      23&lt;BR /&gt;ERROR 23-2: Invalid option name the.&lt;BR /&gt;&lt;BR /&gt;2                                                                          The SAS System                                              08:37 Wednesday, March 3, 2021&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                          ____&lt;BR /&gt;                                          23&lt;BR /&gt;ERROR 23-2: Invalid option name week.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                               __&lt;BR /&gt;                                               23&lt;BR /&gt;ERROR 23-2: Invalid option name of.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                                  ______&lt;BR /&gt;                                                  23&lt;BR /&gt;ERROR 23-2: Invalid option name Sunday.&lt;BR /&gt;&lt;BR /&gt;32       ! BI9161 GCPromo Report for the week of Sunday, February 21, 2021&lt;BR /&gt;                                                          ________&lt;BR /&gt;                                                          23&lt;BR /&gt;ERROR 23-2: Invalid option name February.&lt;BR /&gt;&lt;BR /&gt;33         /*subject='BI9161 GCPromo Report'*/&lt;BR /&gt;SYMBOLGEN:  Macro variable ENAME resolves to GCPROMO_Report_03MAR2021&lt;BR /&gt;34         attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");&lt;BR /&gt;ERROR: Error in the FILENAME statement.</description>
      <pubDate>Wed, 03 Mar 2021 14:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723154#M224355</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2021-03-03T14:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Email Automation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723173#M224364</link>
      <description>After some more tinkering I figured out the issue.&lt;BR /&gt;&lt;BR /&gt;For me to include the REPORT_DT variable I need to use double quotes in the Subject Line&lt;BR /&gt;&lt;BR /&gt;filename mymail email to=('email@email.ca')&lt;BR /&gt;subject= "Report for the week of &amp;amp;REPORT_DT."&lt;BR /&gt;attach=("/data/bi/data/inbox/MTS/&amp;amp;ENAME..csv" content_type="application/xlsx");</description>
      <pubDate>Wed, 03 Mar 2021 15:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Automation/m-p/723173#M224364</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2021-03-03T15:26:43Z</dc:date>
    </item>
  </channel>
</rss>

