<?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 Attaching error for macro mailing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Attaching-error-for-macro-mailing/m-p/509188#M136847</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a slight issue with attaching a file to my macro mail.&lt;/P&gt;&lt;P&gt;The culprit as far as I am aware my dynamic date name function: &amp;amp;today&lt;/P&gt;&lt;P&gt;This is my attachment code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today" content_type="application/xlsx");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For which I receive this error: ERROR: Error opening attachment file&lt;BR /&gt;Physical file does not exist,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried entering the file name exactly WITHOUT using my &amp;amp;today macro and IT DID WORK.&lt;/P&gt;&lt;P&gt;I've also tried adding .xlsx to the end of the target attachment string:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today".xlsx content_type="application/xlsx");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This however did not help and gave me the same error (as If SAS did not detect the full space between &amp;amp;today and xlsm)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The only half-way solution that I found was adding a star (*) to the attachment target string, which would indeed attach the file however in text format and not xlsm.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today*" content_type="application/xlsx");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas would be hugely appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Wed, 31 Oct 2018 16:01:16 GMT</pubDate>
    <dc:creator>Michael_B-T</dc:creator>
    <dc:date>2018-10-31T16:01:16Z</dc:date>
    <item>
      <title>Attaching error for macro mailing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attaching-error-for-macro-mailing/m-p/509188#M136847</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a slight issue with attaching a file to my macro mail.&lt;/P&gt;&lt;P&gt;The culprit as far as I am aware my dynamic date name function: &amp;amp;today&lt;/P&gt;&lt;P&gt;This is my attachment code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today" content_type="application/xlsx");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For which I receive this error: ERROR: Error opening attachment file&lt;BR /&gt;Physical file does not exist,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried entering the file name exactly WITHOUT using my &amp;amp;today macro and IT DID WORK.&lt;/P&gt;&lt;P&gt;I've also tried adding .xlsx to the end of the target attachment string:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today".xlsx content_type="application/xlsx");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This however did not help and gave me the same error (as If SAS did not detect the full space between &amp;amp;today and xlsm)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The only half-way solution that I found was adding a star (*) to the attachment target string, which would indeed attach the file however in text format and not xlsm.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;attach=("\\F:\DI\WR\WeeklyReport_&amp;amp;today*" content_type="application/xlsx");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas would be hugely appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 16:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attaching-error-for-macro-mailing/m-p/509188#M136847</guid>
      <dc:creator>Michael_B-T</dc:creator>
      <dc:date>2018-10-31T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Attaching error for macro mailing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attaching-error-for-macro-mailing/m-p/509195#M136851</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token string"&gt;"\\F:\DI\WR\WeeklyReport_&amp;amp;today&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;xlsx"&lt;/P&gt;
&lt;P&gt;strings have to be in quotes.&lt;/P&gt;
&lt;P&gt;note the two periods. That is intentional as the first one signals the end of the macro variable value&amp;nbsp;and the second is the period in the file name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course if there is no file with the name as resolved then you will still&amp;nbsp;get the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this code and examine the log for how the values resolve.&lt;/P&gt;
&lt;PRE&gt;%let today = 31OCT2018;

%put With 2 periods "\\F:\DI\WR\WeeklyReport_&amp;amp;today..xlsx";
%put without 2 periods "\\F:\DI\WR\WeeklyReport_&amp;amp;today.xlsx";
&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Oct 2018 16:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attaching-error-for-macro-mailing/m-p/509195#M136851</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-31T16:25:08Z</dc:date>
    </item>
  </channel>
</rss>

