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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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