<?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 create an automated email with  table and text  contents. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/319071#M69991</link>
    <description>&lt;P&gt;This works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename REPORT "%sysfunc(pathname(work))\test.html";
filename SEND email to           = "xxx"
                    subject      = "test"
                    from         = "xxx"
                    content_type = "text/html";


ods html file=REPORT;
proc print data=SASHELP.CLASS; run;
ods html close;

data _null_;
  infile REPORT;
  file SEND;
  input;
  if _infile_ ne '&amp;lt;/html&amp;gt;' then put _infile_;
  else do;
    put '&amp;lt;p&amp;gt;More text&amp;lt;/p&amp;gt;&amp;lt;/html&amp;gt;';
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Dec 2016 22:47:39 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2016-12-14T22:47:39Z</dc:date>
    <item>
      <title>how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/319022#M69971</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;Dear Sascommunity,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;I am trying to create an email template with table and text. the table should be on the Top and followed by the Text.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;Here is my sample output examples.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ISO&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;NAME&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ISONAME&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;region&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;pop&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;182&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;050&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BANGLADESH&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BANGLADESH&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;SEAR&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;141,822,276&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;200&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;064&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BHUTAN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;BHUTAN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;SEAR&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2,162,546&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;250&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;104&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;MYANMAR&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;MYANMAR&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;SEAR&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;50,519,492&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Demographic analysis, the statistical description of human populations, is a tool used by government agencies, political parties, and manufacturers of consumer goods. Polls conducted on every topic imaginable, from age to toothpaste preference, give the government and corporations an idea of who the public is and what it needs and wants. The government's census, which is conducted every ten years, is the largest demographic survey of all. They must qualify as economically disadvantaged either by direct certification or a supplemental household survey. Today demographic is also being used as a noun; so, for example, TV advertisers are constantly worrying about how to appeal to the 18-to-24-year-old demographic.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;the below is my sample codes.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=sashelp.DEMOGRAPHICS &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=email;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; region id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; EMAIL(region);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;FILENAME MYMAIL EMAIL&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;TO = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;CC = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUBJECT = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"DEMOGRAPHICS"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;CT = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"TEXT/HTML"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;FROM = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SENDER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;REPLYTO = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;content_type=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"text/html"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA TEMP;&lt;/P&gt;&lt;P&gt;SET email;&lt;/P&gt;&lt;P&gt;BY region ID;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;where region=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;region"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;FILE MYMAIL;&lt;/P&gt;&lt;P&gt;SET TEMP END=EOF;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;IF _N_=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; THEN DO;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;TESTING = Y &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%THEN&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;temail = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;semail = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"tekish20@yahoo.com"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%END&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'!EM_TO! '&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temail;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'!EM_CC! ("'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; semail &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'")'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;font face = "Times New Roman" size = "3" color = "000000"&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Dear "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;p&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;table border = 1&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;tr&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;ID&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;ISO&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NAME&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;ISONAME&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;region&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;pop&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/tr&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;tr&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ISO &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; NAME &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ISONAME &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; region &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pop &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/td&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/tr&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF EOF THEN DO;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/table&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;p&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;TD&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;Demographic analysis, the statistical description of human populations, is a tool used by"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"government agencies, political parties, and manufacturers of consumer goods. Polls conducted "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"on every topic imaginable, from age to toothpaste preference, give the government and"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"corporations an idea of who the public is and what it needs and wants. The government's"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"census, which is conducted every ten years, is the largest demographic survey of all."&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"They must qualify as economically disadvantaged either by direct certification or a supplemental household survey."&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Today demographic is also being used as a noun; so, for example, TV advertisers are constantly"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"worrying about how to appeal to the 18-to-24-year-old demographic."&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;p&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;P&amp;gt;Thank you,"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;PUT &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;lt;/TD&amp;gt;"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME MYMAIL CLEAR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;%MEND&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; EMAIL;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TESTING = Y;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=email &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=drivers(keep=region) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nodupkey&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; region ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_NULL_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; drivers;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; region;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; region=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'SEAR'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; EXECUTE(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'%EMAIL('&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||region||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;')'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;RUN&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 19:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/319022#M69971</guid>
      <dc:creator>tekish</dc:creator>
      <dc:date>2016-12-14T19:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/319071#M69991</link>
      <description>&lt;P&gt;This works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename REPORT "%sysfunc(pathname(work))\test.html";
filename SEND email to           = "xxx"
                    subject      = "test"
                    from         = "xxx"
                    content_type = "text/html";


ods html file=REPORT;
proc print data=SASHELP.CLASS; run;
ods html close;

data _null_;
  infile REPORT;
  file SEND;
  input;
  if _infile_ ne '&amp;lt;/html&amp;gt;' then put _infile_;
  else do;
    put '&amp;lt;p&amp;gt;More text&amp;lt;/p&amp;gt;&amp;lt;/html&amp;gt;';
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Dec 2016 22:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/319071#M69991</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-12-14T22:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/320262#M70501</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961" target="_self"&gt;&lt;SPAN class="login-bold"&gt;ChrisNZ&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 15:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/320262#M70501</guid>
      <dc:creator>tekish</dc:creator>
      <dc:date>2016-12-20T15:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/479318#M123693</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
  infile REPORT;
  file SEND;
  input;
  if _infile_ ne '&amp;lt;/html&amp;gt;' then put _infile_;
  else do;
  &amp;nbsp; infile INFO end=OEF;
    do until EOF;
&amp;nbsp;   &amp;nbsp; input ;
&amp;nbsp; &amp;nbsp;   put _infile_;
    end;
    put '&amp;lt;/html&amp;gt;';
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sorry can't test, there may be errors, but that's the gist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 23:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/479318#M123693</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-18T23:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/479715#M123860</link>
      <description>&lt;P&gt;If you want the text at the top, why do you write it at the bottom?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;lt;/html&amp;gt;&lt;/STRONG&gt; is the bottom of the document (looking for &lt;STRONG&gt;&amp;lt;/body&amp;gt;&lt;/STRONG&gt; would be better test actually).&lt;/P&gt;
&lt;P&gt;And &lt;STRONG&gt;&amp;lt;body&amp;gt;&lt;/STRONG&gt; is the&amp;nbsp;start of the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you understand the code you are running?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 21:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/479715#M123860</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-19T21:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/480291#M124121</link>
      <description>The program modifies a HTML file to add more text. These files' structure is very simple. Look up the structure and you'll see what the issue is. You are adding text at the end of the file, so of course that text appears at the end.</description>
      <pubDate>Sun, 22 Jul 2018 22:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/480291#M124121</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-22T22:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an automated email with  table and text  contents.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/480336#M124131</link>
      <description>&lt;P&gt;Not too sure what more I could supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you write you text when you find &lt;STRONG&gt;&amp;lt;body&amp;gt;&lt;/STRONG&gt; you'll write at the top of the html page.&amp;nbsp;&lt;SPAN&gt;Something like:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _infile_ &lt;SPAN class="token operator"&gt;=:&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'&amp;lt;body'&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;do&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  ***&lt;SPAN class="token keyword"&gt;write additional header&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;*** (see my message #5 with &lt;/SPAN&gt;&lt;/CODE&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;CODE class="  language-sas"&gt;  &lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; INFO end&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;OEF&lt;SPAN class="token punctuation"&gt;;  &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token punctuation"&gt;) &lt;BR /&gt;&lt;/SPAN&gt;  put _infile_; &lt;BR /&gt;end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 02:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-automated-email-with-table-and-text-contents/m-p/480336#M124131</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-23T02:51:11Z</dc:date>
    </item>
  </channel>
</rss>

