<?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: macro to send email with option ATTACH not fill in in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451466#M113829</link>
    <description>It works perfectly thanks !</description>
    <pubDate>Thu, 05 Apr 2018 11:42:55 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2018-04-05T11:42:55Z</dc:date>
    <item>
      <title>macro to send email with option ATTACH not fill in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451456#M113816</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mc_email (to=, from=, cc=, subject=, sender=, texte=, expediteur=, attach=) ;

DATA _null_ ;
slept= sleep(120);
run;

data _null_;
filename mail email to=(&amp;amp;to.) from=&amp;amp;from.
cc=(&amp;amp;cc.)
subject=&amp;amp;subject.
sender=&amp;amp;sender.
ATTACH= (&amp;amp;attach.)
;

file mail;
put 'Bonjour,' ; 
put ' ' ;
put "&amp;amp;texte." ; 
put ' ' ;
put 'Cordialement,' ;
put ' ' ;
put "&amp;amp;expediteur." ;
run;

%mend mc_email ;


%mc_email(  to = &amp;amp;mv_email_destinataire_list, 
		                from = "Mr Nasser",        
		                  cc = &amp;amp;mv_email_copie_list,                    
		             subject = "Execution ra_retention : OK",
		              sender = "lauch_ra_retention.sas",
		               texte = Le programme s est déroulé sans erreur,
		          expediteur = Mr Nasser ,
					attach= );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I call this macro by specifiying a file in the "attach" option--&amp;gt; it works&lt;BR /&gt;I call this macro by NOT specifiying a file in the "attach" option--&amp;gt; it DOES NOT works.&lt;/P&gt;&lt;P&gt;What could I do to make this macro working for both options ("attach" fill in or not) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot in advance for your help&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 11:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451456#M113816</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-04-05T11:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: macro to send email with option ATTACH not fill in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451459#M113824</link>
      <description>&lt;P&gt;Use a condition:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
filename mail email to=(&amp;amp;to.) from=&amp;amp;from.
cc=(&amp;amp;cc.)
subject=&amp;amp;subject.
sender=&amp;amp;sender.
%if "&amp;amp;attach." ne "" %then %do;
ATTACH= (&amp;amp;attach.)
%end;
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Apr 2018 11:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451459#M113824</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-05T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro to send email with option ATTACH not fill in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451461#M113826</link>
      <description>&lt;P&gt;Hello Kurt and thanks for your quick repsonse.&lt;/P&gt;&lt;P&gt;I test&amp;nbsp;your solution.&lt;/P&gt;&lt;P&gt;without specifiied file, it works. but by specifying a file like&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;attach= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/home/ldap/mellouna/lance_prog_cdgr.log"&lt;/FONT&gt; I got an error message&lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;/P&gt;&lt;P&gt;"&amp;amp;attach." ne ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 11:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451461#M113826</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-04-05T11:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: macro to send email with option ATTACH not fill in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451462#M113827</link>
      <description>&lt;P&gt;You can omit the double quotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;attach. ne  %then %do;
ATTACH= (&amp;amp;attach.)
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 11:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451462#M113827</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-05T11:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: macro to send email with option ATTACH not fill in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451466#M113829</link>
      <description>It works perfectly thanks !</description>
      <pubDate>Thu, 05 Apr 2018 11:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-send-email-with-option-ATTACH-not-fill-in/m-p/451466#M113829</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-04-05T11:42:55Z</dc:date>
    </item>
  </channel>
</rss>

