The SAS Output Delivery System and reporting techniques

Send Proc Freq table within an email?

Reply
Occasional Contributor t30
Occasional Contributor
Posts: 14

Send Proc Freq table within an email?

Hi,

 

I routinely have to send a proc freq result in my email as a report.

 

The flow is like this:

1. Extract data

2. Do some manipulation

3. Get the proc freq

4. Screenshot proc freq result and paste in the Outlook email

5. Send email

 

1-3 are already automated. But I still need to manually screenshot it and send the email on a daily basis.

 

What I wish to do is to fully automate this, if a scheduler is too advance, maybe at least I want to automate 4 and 5.

Any tips and advice on how to do so?

Super User
Posts: 20,730

Re: Send Proc Freq table within an email?

[ Edited ]

Search on here, this is a common question and there are a multitude of solutions. In general, it's easier to do it as an attachment than as an embedded image, but I think there was this question on this in the last month on here.

 

EDIT: http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/

Super User
Posts: 8,332

Re: Send Proc Freq table within an email?

Use ODS PDF for the output, and attach the resulting file to the email.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor t30
Occasional Contributor
Posts: 14

Re: Send Proc Freq table within an email?

Posted in reply to KurtBremser
Unfortunately, can't afford an attachment. The receivers would always prefer an embedded html or image rather than having to click and view the attachment.
Super User
Posts: 8,332

Re: Send Proc Freq table within an email?


t30 wrote:
Unfortunately, can't afford an attachment. The receivers would always prefer an embedded html or image rather than having to click and view the attachment.

Then embed ods html output into the mail like this:

ods _all_ close;
filename mymail email 'recipient@domain.com' subject="Test" content_type='text/html';
ods html file=mymail;
proc print data=sashelp.class;
run;
ods html close;
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 4 replies
  • 297 views
  • 0 likes
  • 3 in conversation