The SAS Output Delivery System and reporting techniques

how to insert html text in SAS email body

Reply
Occasional Contributor
Posts: 7

how to insert html text in SAS email body

Hi Could you all please help me in inserting HTML Text with font options in SAS Email. I tried the below code but without proc report in body the output is blank.

 

 

 

filename mymail email from="santh@urbanpro.com"

to=("santh@urbanpro.com")

subject="Territory Sales"
content_type="Text/HTML"
attach = ("/sasdata/sas_codes/NewSales/SalesValid.xls" Content_type="application/excel");
ods _all_ close;
ODS ESCAPECHAR='^';
ods html body=mymail style=minimal;

title j=left font = verdana height=10pt color=black
title "Good Morning, ^{newline 2}

Attached is the Aug 2016 Sales Report. ^{newline 2}


Thanks and Regards, ^{newline 2}

^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Santh S} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Business Analyst} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] GR Team} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Client Analytics } ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] UnrbaPro} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] UBSC, Dekhi 400019, INDIA} ^{newline 2}

^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] TEL }
^{style [ FONT=(verdana,8Pt) color=black ] + 91 40 4090 1000} ^{newline 1}
^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] INTERNAL }

^{style [ FONT=(verdana,8Pt) color=black ] santh@urbanpro.com} ^{newline 5}"
;


proc report data=prod_list;
where type='XSell';
column (odr );
quit;

ods html close;
ods _all_ close;

 

 

I need the only text part with formating but dont want to include any proc report in the mail body.

I appreciate any help on this, Thanks in advance.

Grand Advisor
Posts: 10,233

Re: how to insert html text in SAS email body

Can you post the log of an attempt with that code. From what you posted I expect to see a number of error messages.

Occasional Contributor
Posts: 7

Re: how to insert html text in SAS email body

Than you for the reply Ballardw, 

 

infact there are no errors in log, but the body part is missing when I remove the Proc report code, else the output is fine as I required. attached is the screen shot which I required. Thanks in advance

 

 

Attachment
Grand Advisor
Posts: 10,233

Re: how to insert html text in SAS email body

Titles don't actually get sent to output unless there is something to "attach" the title to. Without the proc report there is not need for a "title" so that text doesn't get sent.

 

I don't use SAS for emails so I can't suggest a specific work around.

Occasional Contributor
Posts: 7

Re: how to insert html text in SAS email body

Thank you Ballardw,

 

will wait for any help in resolving my problem Smiley Happy

SAS Super FREQ
Posts: 8,721

Re: how to insert html text in SAS email body

Hi, you might want to open a track with Tech Support. BallardW is correct, without the PROC REPORT code, there is nothing that needs a title. Unless you were going to rewrite this using a DATA step, I can't think of anything that will work.

I don't quite understand what the PROC REPORT code is supposed to be doing, anyway.

cynthia
Occasional Contributor
Posts: 7

Re: how to insert html text in SAS email body

Thank you Cynthia,

 

Yes, I tried with Datastep and now it is working. Thank you all for your prompt response.

Ask a Question
Discussion stats
  • 6 replies
  • 1316 views
  • 1 like
  • 3 in conversation