options emailsys=smtp;
options emailhost=xxxxxxx;
options emailport=XX;
options emailauthprotocol=NONE;
options emailid="ABC@email.com";
filename outbox EMAIL DEBUG
from="BCA@email.com"
sender="BCA@email.com"
TO=("USER1@email.com")
CC=("USER2@email.com")
CT="TEXT/HTML"
subject="DST REPORT"
/* 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 "<U>DST REPORT</U>" JUSTIFY=CENTER;
TITLE2 FONT="Zurich BT" bold height=2 "<U>Report Run Date: &sysdate. Time: &SYSTIME</U>" JUSTIFY=RIGHT;
column AM_CODE AM TL_CODE TL SO_COUNT &name2 &name1 &name DRR Target "APPROVED _MTD"n
ASSIGNED RESEND UNASSIGNED &LMTD GAP
&APPLOGP &Activep &INACTIVEP &QRAPPR &ACTIVEPA &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 &name2/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &name1/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &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 &LMTD/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define GAP/"GAP" style(column)=[font=("zurich BT",9pt)] spacing=0;
define &APPLOGP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &ACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &INACTIVEP/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &QRAPPR/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &ACTIVEPA/ style(column)=[font=("zurich BT",9pt)] spacing=0;
define &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;
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.
The error it gives:
ERROR: No logical assign for filename OUTBOX.
ERROR: No body file. HTML output will not be created.
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.
Below is the attached screenshot.

Can anyone help with these problems? 🙂
Thanks in advance 🙂 for all contributors.