The SAS Output Delivery System and reporting techniques

Problem when sending HTML-emails

Reply
Contributor
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.

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

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

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

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

%mend;
[/pre]

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

Re: Problem when sending HTML-emails

Posted in reply to tbatliner
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 http://support.sas.com/ and also you will likely find references by doing a Google advanced search against the SAS.COM site (include the parameter site:sas.com in your search string), using related keywords.

Scott Barry
SBBWorks,Inc.

http://www2.sas.com/proceedings/forum2008/038-2008.pdf
Contributor
Posts: 30

Re: Problem when sending HTML-emails

Sorry for my late repy.
Here is the log-entry SAS creates:
[pre]
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.
[/pre]

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
  • 139 views
  • 0 likes
  • 2 in conversation