BookmarkSubscribeRSS Feed
upadhi
Quartz | Level 8

Hi

 

I am trying to use SAS proc print and ODS mail. The issue I am facing is while trying to add border in the table, I am able to print border in the SAS EG output window but the same code is not working in mail.

 

Below is the code I am using expected output and output I am getting.

Kindly Help.

 

 

Expected output (Output in SAS EG)

Expected table.PNG

Output I am getting (Output in Email)

Received Output.PNG

Code:

 

options emailsys=xxxx emailhost=mail.xxx.in emailport=xxx;

filename mail

email to=("xxx.com")

from="xxx.com"

subject="Testing"

content_type="TEXT/HTML";

ods html3 body = mail

style=htmlblue;

ods escapechar='^';

ODS TEXT="^S={font_face='Calibri' font_size=2 fontweight=Medium foreground=black}

<<<<<<Testing>>>>>>>";

proc print data=x

style(data)=[frame = box

bordercolor=black

background=white]

style(obsheader)={background=#C00000 color=white

font_size=7pt

bordercolor=black

just = c}

style(header)={background=#C00000 color=white

font_size=7pt

bordercolor=black

just = c}

style(obs)={background=white color=black

font_size=6pt

bordercolor=black};

run;

ods html3 close;

3 REPLIES 3
andreas_lds
Jade | Level 19

This could be caused by using a crappy mail-client like Outlook, in which even the most basic css features seem to be not yet implemented. Try adding

bordercolor=black borderwidth=1px borderstyle=solid

to the style-option.

upadhi
Quartz | Level 8

no luck! this is not working

andreas_lds
Jade | Level 19

@upadhi wrote:

no luck! this is not working


Please post the code!

 

filename mail email from="xxxxxxx" to="xxxxxxxx" subject="with borders" content_type="text/html";
ods html body=mail;

proc print data=sashelp.class(obs=4) noobs style={bordercolor=black borderwidth=1px borderstyle=solid};
run;

ods html close;
filename mail clear;

Result:

community_mail_borders.PNG

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3739 views
  • 0 likes
  • 2 in conversation