BookmarkSubscribeRSS Feed
tbatliner
Calcite | Level 5
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
tbatliner
Calcite | Level 5
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 777 views
  • 0 likes
  • 2 in conversation