The SAS Output Delivery System and reporting techniques

Sending emails from SAS with embedded table from dataset

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

Sending emails from SAS with embedded table from dataset

Greetings,

 

1. I would like to send email using SAS, and would like to include a table from SAS embedded inside the email itself (not with attached file).

2. What would be the best way to address this issue? Should I use ODS for this or some other process?

 

Thanks!

 


Accepted Solutions
Solution
‎09-25-2016 03:46 AM
New Contributor
Posts: 2

Re: Sending emails from SAS with embedded table from dataset

This will Produce a table inside the email.

 

options emailsys=smtp;

options emailauthprotocol=none;

options emailhost="xx.xx.xx";

options emailport=25;

options emailpw = "xxxxxx";

 

 

filename temp email

to = ( "xxxxx@xxxx.com" )

cc = ("xxxxx@xxxx.com" )

subject="Email With Table"

type="text/html"

from = "xxxxx@xxxx.com"

reply = "xxxxx@xxxx.com" ;

 

 

 

 

 

ODS html body=temp style = noline;

ods html text = "Good Morning,";

ods html text = "";

 

PROC REPORT DATA=X nowd HEADLINE HEADSKIP

 

style (report) = {background = white

font_face = "Verdana" font_size = 7pt just=left }

style (column) = {background = white CELLHEIGHT = 2.5%

font_face = "Verdana" font_size = 7pt just=left}

style (header) = {foreground = cx5e2750 font_face="Verdana"

font_size = 8pt just=left

background = white} ;

columns

DATE

TIME

FN

C;

DEFINE DATE / 'Date';

define TIME / 'Time';

define FN / "File Name";

define C / "Run Number";

 

run;

 

 

 

 

 

ods html text = "Have a Great Day.";

ods _all_ close;

 

Cheers.

View solution in original post


All Replies
Solution
‎09-25-2016 03:46 AM
New Contributor
Posts: 2

Re: Sending emails from SAS with embedded table from dataset

This will Produce a table inside the email.

 

options emailsys=smtp;

options emailauthprotocol=none;

options emailhost="xx.xx.xx";

options emailport=25;

options emailpw = "xxxxxx";

 

 

filename temp email

to = ( "xxxxx@xxxx.com" )

cc = ("xxxxx@xxxx.com" )

subject="Email With Table"

type="text/html"

from = "xxxxx@xxxx.com"

reply = "xxxxx@xxxx.com" ;

 

 

 

 

 

ODS html body=temp style = noline;

ods html text = "Good Morning,";

ods html text = "";

 

PROC REPORT DATA=X nowd HEADLINE HEADSKIP

 

style (report) = {background = white

font_face = "Verdana" font_size = 7pt just=left }

style (column) = {background = white CELLHEIGHT = 2.5%

font_face = "Verdana" font_size = 7pt just=left}

style (header) = {foreground = cx5e2750 font_face="Verdana"

font_size = 8pt just=left

background = white} ;

columns

DATE

TIME

FN

C;

DEFINE DATE / 'Date';

define TIME / 'Time';

define FN / "File Name";

define C / "Run Number";

 

run;

 

 

 

 

 

ods html text = "Have a Great Day.";

ods _all_ close;

 

Cheers.

Contributor
Posts: 23

Re: Sending emails from SAS with embedded table from dataset

Thanks! Work like a charm Smiley Happy

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 686 views
  • 2 likes
  • 2 in conversation