The SAS Output Delivery System and reporting techniques

Problem when sending HTML-emails

Posts: 30

Problem when sending HTML-emails

Hi all,

I'm jusing the following code to send emails. Unfortunately an error occurs because for the first recipient SAS can't find the file which is specified in filename.

%macro send (rec,subject,bdy,filename,from);
ods html file = "&filename" style=sasweb;

options nodate pagesize=60 linesize=64;
data _null_;
file print;
put #3 @5 text1 $;
put #4 @5 text2 $;
ods html close;

filename emails email "&rec." subject="&subject" type="text/html" from="&from.";
filename html "&filename";

data _null_;
infile html;
file emails;
put _INFILE_;


Any ideas are highly welcome!
Tia and best regards,
Super Contributor
Super Contributor
Posts: 3,174

Re: Problem when sending HTML-emails

What is the exact error in your SASLOG? Best approach is to paste the SASLOG before and after the error condition.

Also, it is unclear why you cannot combine the two DATA steps, presuming what you want to accomplish is to have the first DATA step's PUT reference inside the body of the EMAIL.

There are several technical and DOC references on this topic at the SAS support website and also you will likely find references by doing a Google advanced search against the SAS.COM site (include the parameter in your search string), using related keywords.

Scott Barry
Posts: 30

Re: Problem when sending HTML-emails

Sorry for my late repy.
Here is the log-entry SAS creates:
NOTE: Writing HTML Body file: j:\temp\status.html
ERROR: A component of K:\SAS_WORK\_TD1060\Prc44\36c097fb-3d48-48c5-a861-7445732e228b\j:\temp\status.html is not a directory.
WARNING: No body file. HTML output will not be created.
WARNING: No output destinations active.

As I said it only occurs for the first recipient. SAS doesn't seem to find the correct Path...
Thanks for the link!

br Thomas
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation