<?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: How to resolve the macro variable in html message in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666039#M199227</link>
    <description>Thank you very much Kurt!&lt;BR /&gt;It works!&lt;BR /&gt;Marie</description>
    <pubDate>Tue, 30 Jun 2020 11:39:43 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2020-06-30T11:39:43Z</dc:date>
    <item>
      <title>How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666022#M199222</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a question.&lt;/P&gt;
&lt;P&gt;In my table SAS, the column CODE_PRODUIT hase the values: CD1, CD2, CD3, CD4. This values can change.&lt;/P&gt;
&lt;P&gt;I would like that this values appear in my e-mail, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FILENAME outmail EMAIL&lt;BR /&gt;SUBJECT= "PRODUCT"&lt;BR /&gt;type='text/html'&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FROM= ‘XXXX’&lt;/P&gt;
&lt;P&gt;TO=&amp;nbsp; (‘XXXX’‘XXXX’)&lt;/P&gt;
&lt;P&gt;CC=(‘XXXX’)&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;file outmail;&lt;/P&gt;
&lt;P&gt;if _N_=&lt;STRONG&gt;1&lt;/STRONG&gt; then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"Hello,"'&amp;lt;/html&amp;gt;';&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"The values are:"'&amp;lt;/html&amp;gt;';&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"-CD1"'&amp;lt;/html&amp;gt;'; /***new line***/&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"-CD2"'&amp;lt;/html&amp;gt;';&amp;nbsp;/***new line***/&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"-CD3"'&amp;lt;/html&amp;gt;';&amp;nbsp;/***new line***/&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is: do you know some option to resolve the macro variable in html message?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code doesn't work: I can't resolve the macro variable&amp;nbsp;&amp;amp;liste_PRODUIT2. in my e-mail:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data CODE_PRODUIT2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set CODE_PRODUIT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; code_1="PUT'&amp;lt;html&amp;gt;'";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; code_2=quote('A0'x||'A0'x||'A0'x||("-")||(CODE_PRODUIT));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; code_3="'&amp;lt;/html&amp;gt;';";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CODE_PRODUIT_2=compress(code_1||code_2||code_3);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql noprint;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct strip(CODE_PRODUIT_2) into :liste_PRODUIT2 separated by ''&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; from CODE_PRODUIT2;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put "&amp;amp;liste_PRODUIT2.";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file outmail;&lt;/P&gt;
&lt;P&gt;if _N_=1 then&lt;BR /&gt;do;&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"Hello,"'&amp;lt;/html&amp;gt;';&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;'"The values are:"'&amp;lt;/html&amp;gt;';&lt;/P&gt;
&lt;P&gt;PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';&lt;BR /&gt;%put &amp;amp;liste_PRODUIT2.&lt;BR /&gt;PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';&lt;BR /&gt;PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';&lt;BR /&gt;PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';&lt;BR /&gt;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank ypu for you help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 09:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666022#M199222</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-30T09:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666025#M199223</link>
      <description>&lt;P&gt;Don't use a %PUT macro statement to output data to the FILE destination. %PUT writes only to the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file outmail;
if _N_=1 then
do;
  PUT '&amp;lt;html&amp;gt;'"Hello,"'&amp;lt;/html&amp;gt;';
  PUT '&amp;lt;html&amp;gt;'"The values are:"'&amp;lt;/html&amp;gt;';
  PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';
  put "&amp;amp;liste_PRODUIT2.";
  PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';
  PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';
  PUT '&amp;lt;html&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/html&amp;gt;';
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 10:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666025#M199223</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-30T10:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666039#M199227</link>
      <description>Thank you very much Kurt!&lt;BR /&gt;It works!&lt;BR /&gt;Marie</description>
      <pubDate>Tue, 30 Jun 2020 11:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666039#M199227</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-30T11:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666062#M199232</link>
      <description>&lt;P&gt;I have a little problem with my macro variable, I receive this in my e-mail (via html message):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;. -T340GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-T341GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-T387GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to delete the dot on the first line, but I suppose it is an html issue.&lt;/P&gt;
&lt;P&gt;Do you have please some options for that?&lt;/P&gt;
&lt;P&gt;Thank you very much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 12:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666062#M199232</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-30T12:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666096#M199241</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a little problem with my macro variable, I receive this in my e-mail (via html message):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;. -T340GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-T341GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-T387GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to delete the dot on the first line, but I suppose it is an html issue.&lt;/P&gt;
&lt;P&gt;Do you have please some options for that?&lt;/P&gt;
&lt;P&gt;Thank you very much!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One strongly suspects that your code is Putting a missing value. You may resolve that by placing this line &lt;STRONG&gt;before&lt;/STRONG&gt; the data step that writes to the file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options missing=' ';&amp;nbsp; (yes that is a single space between the quotes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then any missing value will display as a blank.&lt;/P&gt;
&lt;P&gt;You should reset the option back to the dot after the step. Otherwise you may get confused when you no longer see dots for missing values.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 14:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666096#M199241</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-30T14:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the macro variable in html message</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666099#M199243</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much, that works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Marie&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 14:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-resolve-the-macro-variable-in-html-message/m-p/666099#M199243</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2020-06-30T14:34:40Z</dc:date>
    </item>
  </channel>
</rss>

