<?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 add macro values in email body in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862414#M340663</link>
    <description>&lt;P&gt;Can you please share your current code that creates the email.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 05:49:33 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-03-06T05:49:33Z</dc:date>
    <item>
      <title>How to add macro values in email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862407#M340662</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a scenario where i have to add the table values as email body but i am not able to do it for multiple lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the SAS dummy program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;infile datalines;&lt;BR /&gt;input part $ bldg $ area $ po $;&lt;BR /&gt;datalines;&lt;BR /&gt;A1 FR KIT XX1&lt;BR /&gt;A2 W KIT XX1&lt;BR /&gt;A3 FR LOIN XX4&lt;BR /&gt;C3 FR KIT XX6&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the email body should be : This can be n number of observations. Can anyone help me to get this looped.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A1 is routed to FR KIT but does not have a coordinate on XX1.Determine the correct coordinate and add it.&lt;BR /&gt;A2 is routed to W KIT but does not have a coordinate on XX1.Determine the correct coordinate and add it.&lt;BR /&gt;A3 is routed to FR LOIN but does not have a coordinate on XX4.Determine the correct coordinate and add it.&lt;BR /&gt;C3 is routed to FR KIT but does not have a coordinate on XX6.Determine the correct coordinate and add it.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 03:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862407#M340662</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2023-03-06T03:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add macro values in email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862414#M340663</link>
      <description>&lt;P&gt;Can you please share your current code that creates the email.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 05:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862414#M340663</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-03-06T05:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add macro values in email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862446#M340676</link>
      <description>&lt;P&gt;I am not sure how to loop the macro values,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below code i tried but it reads only first value in the macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;infile datalines;&lt;BR /&gt;input part $ bldg $ area $ po $;&lt;BR /&gt;datalines;&lt;BR /&gt;A1 FR KIT XX1&lt;BR /&gt;A2 W KIT XX1&lt;BR /&gt;A3 FR LOIN XX4&lt;BR /&gt;C3 FR KIT XX6&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;select part into: part_list from test;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;select bldg into: bldg_list from test;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;select area into: area_list from test;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;select po into: po_list from test;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;date.;&lt;BR /&gt;OPTIONS EMAILSYS=SMTP EMAILHOST=intramail.cis.cat.com EMAILID="test@mail.com";&lt;BR /&gt;FILENAME BLAT EMAIL&lt;BR /&gt;FROM = ( "test@mail.com" )&lt;BR /&gt;TO = ("rec@mail.com" )&lt;BR /&gt;SUBJECT = ("&amp;amp;subject.– &amp;amp;date")&lt;BR /&gt;TYPE = "TEXT/HTML"&lt;/P&gt;
&lt;P&gt;;&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;FILE BLAT;&lt;BR /&gt;put "Team,&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";&lt;BR /&gt;PUT "&amp;amp;part_list. is routed to &amp;amp;bldg_list. &amp;amp;area_list but does not have a coordinate on &amp;amp;po_list..Determine the correct coordinate and add it.&lt;BR /&gt;&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";&lt;BR /&gt;PUT " ";&lt;BR /&gt;PUT "Regards,&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 09:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862446#M340676</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2023-03-06T09:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add macro values in email body</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862454#M340680</link>
      <description>&lt;P&gt;I do not think you should loop the macro variables for the email content, just read the data, something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;
FILE BLAT;
set test end=done:
if _N_=1 then 
  put "Team,&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";
PUT part "is routed to " bldg. area "but does not have a coordinate on " po ". Determine the correct coordinate and add it. &amp;lt;BR&amp;gt;";
if done;
PUT "&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";
PUT "Regards,&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2023 10:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-macro-values-in-email-body/m-p/862454#M340680</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-03-06T10:29:27Z</dc:date>
    </item>
  </channel>
</rss>

