BookmarkSubscribeRSS Feed
Kirito1
Quartz | Level 8
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.

Kirito1_0-1675764820198.png

 

Can anyone help with these problems? 🙂

Thanks in advance 🙂 for all contributors.

3 REPLIES 3
czejap
SAS Employee
Hello
Maybe ODS HTML FILE is problem. Try:
ODS HTML BODY=outbox STYLE=htmlblue;



Kirito1
Quartz | Level 8

It is not giving me the below error:

Kirito1_0-1675765135153.png

 

Kurt_Bremser
Super User

The last ERROR or WARNING is always the least important. The first message is most important, as fixing the first problem usually fixes most, if not all, following issues.

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:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 722 views
  • 0 likes
  • 3 in conversation