<?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: Formatting Email Spacing Between Text and Reports in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476132#M21267</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; I typically send email as an attachment because many companies don't allow email with HTML in the body of the mail or they convert the HTML to plain text before delivery. With an attachment of the report as a PDF or RTF file, I am more sure that the mail will go through the system unchanged.&lt;BR /&gt;&lt;BR /&gt;I see that you're using ODS HTML3 -- that is older HTML destination. You're getting a logical PAGE break (that horizontal rule is an HTML indicator of a page break) between each of your outputs because of the DATA _NULL_ steps. Have you considered using ODS TEXT=. I did not send an email, but I created output with the following code (using your same template):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS _ALL_ CLOSE;
ODS PDF BODY="c:\temp" FILE="usetext_acro.pdf" STYLE=SASWEBMOD startpage=no;
ODS HTML4 BODY="c:\temp" FILE="usetext_ht4.html" RS=NONE STYLE=SASWEBMOD;
ODS HTML3 BODY="c:\temp" FILE="usetext_ht3.html" RS=NONE STYLE=SASWEBMOD;
OPTIONS NOCENTER;

/*OPENING TEXT*/
ods text="The text that precedes the SAS Report goes here.";
 

/*REPORT*/
TITLE1 "SAS Report header goes here.";
PROC REPORT DATA = SASHELP.CLASS(OBS=5);
  COLUMNS _ALL_;
  DEFINE  _ALL_    / DISPLAY CENTER;
RUN;
TITLE;

/*CLOSING TEXT*/
ods text="The text that follows the SAS Report goes here.";
 

ODS _ALL_ CLOSE; 
ODS LISTING; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and got these results in the HTML3 output file:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use_ods_text_examp.png" style="width: 460px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21624i3476EE6EC29A99A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="use_ods_text_examp.png" alt="use_ods_text_examp.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jul 2018 19:58:05 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-07-06T19:58:05Z</dc:date>
    <item>
      <title>Formatting Email Spacing Between Text and Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476128#M21266</link>
      <description>&lt;P&gt;Greetings from Minnesota;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sending an email via SAS code, and I am having some trouble with some of the formatting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully figured out how to put text, then a report, and then more text into the email; moreover, I added a PROC FORMAT to modify a STYLE to remove borders and unnecessary style effects from my text. However, there are large gaps (spacings, margins, etc. - I'm not sure of the proper term) before and after my "opening" and "closing" texts. Is there a way to collapse these large spaces to produce a much shorter email body?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Code&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;PROC TEMPLATE;
  DEFINE STYLE STYLES.SASWEBMOD;
    PARENT=STYLES.SASWEB;
      CLASS SYSTITLEANDFOOTERCONTAINER / HTMLSTYLE="BORDER:NONE";
  END;
RUN;

FILENAME MYMAIL EMAIL
  FROM          = "JOHN_DOE@COMPANY.COM"
  TO            = "JOHN_DOE@COMPANY.COM"
  SUBJECT       = "TEST EMAIL SUBJECT"
  CONTENT_TYPE  = "TEXT/HTML";

ODS _ALL_ CLOSE;
ODS HTML3 BODY=MYMAIL RS=NONE STYLE=SASWEBMOD;
OPTIONS NOCENTER;

/*OPENING TEXT*/
DATA _NULL_;
   FILE PRINT;
PUT  "The text that precedes the SAS Report goes here.";
RUN;

/*REPORT*/
TITLE1 "SAS Report header goes here.";
PROC REPORT DATA = SASHELP.CLASS(OBS=5);
  COLUMNS _ALL_;
  DEFINE  _ALL_    / DISPLAY CENTER;
RUN;
TITLE;

/*CLOSING TEXT*/
DATA _NULL_;
   FILE PRINT;
PUT  "The text that proceeds the SAS Report goes here.";
RUN;

ODS _ALL_ CLOSE; 
ODS LISTING; &lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample Output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EmailExample.JPG" style="width: 472px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21623i362FD6384BE1C2AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="EmailExample.JPG" alt="EmailExample.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 19:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476128#M21266</guid>
      <dc:creator>DanielJForman</dc:creator>
      <dc:date>2018-07-06T19:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Email Spacing Between Text and Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476132#M21267</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; I typically send email as an attachment because many companies don't allow email with HTML in the body of the mail or they convert the HTML to plain text before delivery. With an attachment of the report as a PDF or RTF file, I am more sure that the mail will go through the system unchanged.&lt;BR /&gt;&lt;BR /&gt;I see that you're using ODS HTML3 -- that is older HTML destination. You're getting a logical PAGE break (that horizontal rule is an HTML indicator of a page break) between each of your outputs because of the DATA _NULL_ steps. Have you considered using ODS TEXT=. I did not send an email, but I created output with the following code (using your same template):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS _ALL_ CLOSE;
ODS PDF BODY="c:\temp" FILE="usetext_acro.pdf" STYLE=SASWEBMOD startpage=no;
ODS HTML4 BODY="c:\temp" FILE="usetext_ht4.html" RS=NONE STYLE=SASWEBMOD;
ODS HTML3 BODY="c:\temp" FILE="usetext_ht3.html" RS=NONE STYLE=SASWEBMOD;
OPTIONS NOCENTER;

/*OPENING TEXT*/
ods text="The text that precedes the SAS Report goes here.";
 

/*REPORT*/
TITLE1 "SAS Report header goes here.";
PROC REPORT DATA = SASHELP.CLASS(OBS=5);
  COLUMNS _ALL_;
  DEFINE  _ALL_    / DISPLAY CENTER;
RUN;
TITLE;

/*CLOSING TEXT*/
ods text="The text that follows the SAS Report goes here.";
 

ODS _ALL_ CLOSE; 
ODS LISTING; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and got these results in the HTML3 output file:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use_ods_text_examp.png" style="width: 460px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21624i3476EE6EC29A99A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="use_ods_text_examp.png" alt="use_ods_text_examp.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 19:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476132#M21267</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-07-06T19:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Email Spacing Between Text and Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476521#M21275</link>
      <description>Thank you, Cynthia. All I needed to do was swap out my DATA _NULL_ statements for ODS TEXT = " ". It worked perfectly.</description>
      <pubDate>Mon, 09 Jul 2018 16:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Formatting-Email-Spacing-Between-Text-and-Reports/m-p/476521#M21275</guid>
      <dc:creator>DanielJForman</dc:creator>
      <dc:date>2018-07-09T16:57:12Z</dc:date>
    </item>
  </channel>
</rss>

