<?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 Sending attachment with PROC REPORT ? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857516#M37820</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailsys=smtp;
options emailhost=xxxxxxx;
options emailport=XX;
options emailauthprotocol=NONE;
options emailid="ABC@email.com";&amp;nbsp;
filename outbox EMAIL DEBUG
from="BCA@email.com"
sender="BCA@email.com"&amp;nbsp;
TO=("USER1@email.com")
CC=("USER2@email.com")&amp;nbsp;
CT="TEXT/HTML"
subject="DST REPORT"&amp;nbsp;
/* ATTACH=("" content_type=""); */
ATTACH=("/SAS_library/NAS/QR/QR/Outfile_file/DST_REPORT.csv" content_type="csv");


ODS HTML FILE=outbox RS=NONE style=Htmlblue;
options compress=yes;

PROC REPORT DATA=FINAL_DST_REPOT_TABLE nowd spanrows
style(report)=[JUST=CENTER OUTPUTWIDTH=95% CELLSPACING=2 BORDERCOLOR=BLACK BORDERWIDTH=2]
STYLE(HEADER)={BORDERCOLOR=BLACK FOREGROUND=WHITE BACKGROUND= purple FONT=("zurich BT",7pt)}
STYLE(COLUMN)={TAGATTR="WRAP" JUST=CENTER FONT=("zurich BT",08pt) OUTPUTWIDTH=0.05IN BACKGROUND= whitesmoke
FOREGROUND=BLACK BORDERCOLOR=BLACK};

TITLE FONT="Zurich BT" bold height=6 "&amp;lt;U&amp;gt;DST REPORT&amp;lt;/U&amp;gt;" JUSTIFY=CENTER;
TITLE2 FONT="Zurich BT" bold height=2 "&amp;lt;U&amp;gt;Report Run Date: &amp;amp;sysdate. Time: &amp;amp;SYSTIME&amp;lt;/U&amp;gt;" JUSTIFY=RIGHT;

column AM_CODE AM TL_CODE TL SO_COUNT &amp;amp;name2 &amp;amp;name1 &amp;amp;name DRR Target "APPROVED _MTD"n 
ASSIGNED RESEND UNASSIGNED &amp;amp;LMTD GAP 
&amp;amp;APPLOGP &amp;amp;Activep &amp;amp;INACTIVEP &amp;amp;QRAPPR  &amp;amp;ACTIVEPA &amp;amp;APPLOGPA;
define AM_CODE/"AM_CODE" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define AM/"AM" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define TL_CODE/"TL Code" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define TL/"TL Name" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define SO_COUNT/"So Count" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name2/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name1/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define DRR/"DRR" style(column)=[font=("zurich BT",9pt)] spacing=0;
define Target/"TARGET" style(column)=[font=("zurich BT",9pt)] spacing=0;
define "APPROVED _MTD"n/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define ASSIGNED/"ASSIGNED" style(column)=[font=("zurich BT",9pt)] spacing=0;
define RESEND/"RESEND" style(column)=[font=("zurich BT",9pt)] spacing=0;
define UNASSIGNED/"UNASSIGNED" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;LMTD/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define GAP/"GAP" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;APPLOGP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;ACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;INACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;QRAPPR/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;ACTIVEPA/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;APPLOGPA/ style(column)=[font=("zurich BT",9pt)] spacing=0;


break after AM / summarize style={background=lightorange};


  rbreak after / summarize style=Header;
  compute after AM;
  AM = 'AM Total';
  endcomp;
 
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am unable to send an attachment with the report I generated but If I remove attachment lines it sends an email with the report generated.&lt;/P&gt;
&lt;P&gt;The error it gives:&lt;/P&gt;
&lt;PRE&gt;ERROR: No logical assign for filename OUTBOX.
ERROR: No body file. HTML output will not be created.&lt;/PRE&gt;
&lt;P&gt;PROBLEM 2: WHILE mailing the report the TL NAME column is wrapping the text how can I avoid that? the yellow highlighted should not be wrapped.&lt;/P&gt;
&lt;P&gt;Below is the attached screenshot.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1675764820198.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80164i9F49183A22FA0EC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1675764820198.png" alt="Kirito1_0-1675764820198.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help with these problems? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; for all contributors.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 10:14:48 GMT</pubDate>
    <dc:creator>Kirito1</dc:creator>
    <dc:date>2023-02-07T10:14:48Z</dc:date>
    <item>
      <title>Sending attachment with PROC REPORT ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857516#M37820</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailsys=smtp;
options emailhost=xxxxxxx;
options emailport=XX;
options emailauthprotocol=NONE;
options emailid="ABC@email.com";&amp;nbsp;
filename outbox EMAIL DEBUG
from="BCA@email.com"
sender="BCA@email.com"&amp;nbsp;
TO=("USER1@email.com")
CC=("USER2@email.com")&amp;nbsp;
CT="TEXT/HTML"
subject="DST REPORT"&amp;nbsp;
/* ATTACH=("" content_type=""); */
ATTACH=("/SAS_library/NAS/QR/QR/Outfile_file/DST_REPORT.csv" content_type="csv");


ODS HTML FILE=outbox RS=NONE style=Htmlblue;
options compress=yes;

PROC REPORT DATA=FINAL_DST_REPOT_TABLE nowd spanrows
style(report)=[JUST=CENTER OUTPUTWIDTH=95% CELLSPACING=2 BORDERCOLOR=BLACK BORDERWIDTH=2]
STYLE(HEADER)={BORDERCOLOR=BLACK FOREGROUND=WHITE BACKGROUND= purple FONT=("zurich BT",7pt)}
STYLE(COLUMN)={TAGATTR="WRAP" JUST=CENTER FONT=("zurich BT",08pt) OUTPUTWIDTH=0.05IN BACKGROUND= whitesmoke
FOREGROUND=BLACK BORDERCOLOR=BLACK};

TITLE FONT="Zurich BT" bold height=6 "&amp;lt;U&amp;gt;DST REPORT&amp;lt;/U&amp;gt;" JUSTIFY=CENTER;
TITLE2 FONT="Zurich BT" bold height=2 "&amp;lt;U&amp;gt;Report Run Date: &amp;amp;sysdate. Time: &amp;amp;SYSTIME&amp;lt;/U&amp;gt;" JUSTIFY=RIGHT;

column AM_CODE AM TL_CODE TL SO_COUNT &amp;amp;name2 &amp;amp;name1 &amp;amp;name DRR Target "APPROVED _MTD"n 
ASSIGNED RESEND UNASSIGNED &amp;amp;LMTD GAP 
&amp;amp;APPLOGP &amp;amp;Activep &amp;amp;INACTIVEP &amp;amp;QRAPPR  &amp;amp;ACTIVEPA &amp;amp;APPLOGPA;
define AM_CODE/"AM_CODE" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define AM/"AM" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define TL_CODE/"TL Code" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define TL/"TL Name" group style(column)=[font=("zurich BT",7pt)] spacing=0;
define SO_COUNT/"So Count" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name2/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name1/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;name/  style(column)=[font=("zurich BT",9pt)] spacing=0;
define DRR/"DRR" style(column)=[font=("zurich BT",9pt)] spacing=0;
define Target/"TARGET" style(column)=[font=("zurich BT",9pt)] spacing=0;
define "APPROVED _MTD"n/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define ASSIGNED/"ASSIGNED" style(column)=[font=("zurich BT",9pt)] spacing=0;
define RESEND/"RESEND" style(column)=[font=("zurich BT",9pt)] spacing=0;
define UNASSIGNED/"UNASSIGNED" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;LMTD/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define GAP/"GAP" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;APPLOGP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;ACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;INACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;QRAPPR/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;ACTIVEPA/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &amp;amp;APPLOGPA/ style(column)=[font=("zurich BT",9pt)] spacing=0;


break after AM / summarize style={background=lightorange};


  rbreak after / summarize style=Header;
  compute after AM;
  AM = 'AM Total';
  endcomp;
 
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am unable to send an attachment with the report I generated but If I remove attachment lines it sends an email with the report generated.&lt;/P&gt;
&lt;P&gt;The error it gives:&lt;/P&gt;
&lt;PRE&gt;ERROR: No logical assign for filename OUTBOX.
ERROR: No body file. HTML output will not be created.&lt;/PRE&gt;
&lt;P&gt;PROBLEM 2: WHILE mailing the report the TL NAME column is wrapping the text how can I avoid that? the yellow highlighted should not be wrapped.&lt;/P&gt;
&lt;P&gt;Below is the attached screenshot.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1675764820198.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80164i9F49183A22FA0EC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1675764820198.png" alt="Kirito1_0-1675764820198.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help with these problems? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; for all contributors.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 10:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857516#M37820</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-02-07T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sending attachment with PROC REPORT ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857517#M37821</link>
      <description>Hello &lt;BR /&gt;Maybe ODS HTML FILE is problem. Try:&lt;BR /&gt;ODS HTML BODY=outbox STYLE=htmlblue;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Feb 2023 10:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857517#M37821</guid>
      <dc:creator>czejap</dc:creator>
      <dc:date>2023-02-07T10:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sending attachment with PROC REPORT ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857520#M37822</link>
      <description>&lt;P&gt;It is not giving me the below error:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1675765135153.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80165iDF64212B5BA06934/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1675765135153.png" alt="Kirito1_0-1675765135153.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 10:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857520#M37822</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-02-07T10:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sending attachment with PROC REPORT ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857521#M37823</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;last&lt;/EM&gt; ERROR or WARNING is always the&amp;nbsp;&lt;EM&gt;least important&lt;/EM&gt;. The&amp;nbsp;&lt;EM&gt;first&lt;/EM&gt; message is&amp;nbsp;&lt;EM&gt;most&lt;/EM&gt; important, as fixing the first problem usually fixes most, if not all, following issues.&lt;/P&gt;
&lt;P&gt;I suspect that your FILENAME fails, so you need to post the log from the beginning to the FILENAME, including all messages, by copy/pasting into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 10:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sending-attachment-with-PROC-REPORT/m-p/857521#M37823</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-02-07T10:26:12Z</dc:date>
    </item>
  </channel>
</rss>

