BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mar1ene
Obsidian | Level 7

Hello,

 

I use Enterprise 7.1 and coded the below to generate email output, however want to add column/row lines to the tables (output example at the bottom)

 

options emailsys=smtp emailhost= localhost emailport=25;

FILENAME OUTPUT EMAIL
SUBJECT = "EMAIL SUBJECT"
attach=("/Path/File_Name.xlsx" content_type="application/xlsx")
FROM = "Me@stuff.co.za"
TO=('Person1@stuff.co.za' 'Person2@stuff.co.za')
type='text/html'
CT ='text/html';

 

ods html3 body=OUTPUT

style=htmlblue;
ods escapechar='^';
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Good Day,";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Summarised view below.";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Kind Regards,";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";

 

proc print data=Source_Table noobs;
VAR Loan_Purpose Pricing Loan_Amount n;
format loan_amount comma20.;
TITLE "TABLE TITLE";
Footnote1 "Lottery is based on Male population";
Footnote2 "Average shoe price just over R1k";
run;

 

ods html3 close;

 

BTW! I erased the Excel attached due to confidentiality 😄

SAS example email.jpg

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FredrikE
Rhodochrosite | Level 12

Hi!

For me it worked by adding a style (table) with frame=box and width:

proc print data=sashelp.class noobs
 style (table) = [frame=box borderwidth=1 ];
;
VAR sex name age;
TITLE "TABLE TITLE";
Footnote1 "Lottery is based on Male population";
Footnote2 "Average shoe price just over R1k";
run;

More info in this:

http://support.sas.com/resources/papers/proceedings13/366-2013.pdf

 

//Fredrik

View solution in original post

12 REPLIES 12
ballardw
Super User

Try removing the NOOBS option on the Proc Print statement. That option specifically excludes observation numbers.

Mar1ene
Obsidian | Level 7

Thank you Ballardw :D,

 

I understand that, however I want to add physical lines (like excel formatting) to the tables to read the data easier.

 

M

Tom
Super User Tom
Super User

Are you asking how to use the FOOTNOTE statement?

Mar1ene
Obsidian | Level 7

LOL Tom 😜

 

I want to add physical lines to my email tables.  Like in excel, separating columns and rows to read the data easier.

 

M

ballardw
Super User

@Mar1ene wrote:

Thank you Ballardw :D,

 

I understand that, however I want to add physical lines (like excel formatting) to the tables to read the data easier.

 

M


????

 

Appearance in SAS is done with style elements. Each variable in proc print can have an specific style elements set, font size, weight color, back ground color as a start.

 

But I have no idea what you mean by "like excel formatting" when used with "add physical lines".

If you want additional text that does not appear from proc print then perhaps Proc ODSTEXT (not the same as the ODS text you show).

FredrikE
Rhodochrosite | Level 12

Maybe you can use some of these 🙂

 

The perfect grid?!

 

http://www2.sas.com/proceedings/forum2008/258-2008.pdf

 

Seemes that mail clients might change the HTML...:

https://communities.sas.com/t5/ODS-and-Base-Reporting/Missing-gridlines/td-p/262943

 

//Fredrik

Mar1ene
Obsidian | Level 7
thank you Fredrik!! very helpful... I saved this for future reference...
Mar1ene
Obsidian | Level 7

This is what I want to do... add lines to the table in the email... ...:D just prettier... this is a paintbrush job...

SAS example.jpg

 

SAS example table.jpg

 

 

FredrikE
Rhodochrosite | Level 12

Hi!

For me it worked by adding a style (table) with frame=box and width:

proc print data=sashelp.class noobs
 style (table) = [frame=box borderwidth=1 ];
;
VAR sex name age;
TITLE "TABLE TITLE";
Footnote1 "Lottery is based on Male population";
Footnote2 "Average shoe price just over R1k";
run;

More info in this:

http://support.sas.com/resources/papers/proceedings13/366-2013.pdf

 

//Fredrik

Mar1ene
Obsidian | Level 7
Fredrik, you are my fudging hero!! Thank you soooo much!! This is exactly what I wanted!!
Tom
Super User Tom
Super User

So you wanted to add borders around the cells in the table.

It sounded like you wanted to add lines of text.

Mar1ene
Obsidian | Level 7

Hi Tom,

 

I have to agree, I could have worded my question better... I guess it comes with not being English 😜 ... Thank you for wanting to assist anyway!!

 

M

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 13898 views
  • 2 likes
  • 4 in conversation