从SAS发送包含报告和正文的电子邮件

从SAS发送包含报告和正文的电子邮件,sas,enterprise-guide,proc-report,Sas,Enterprise Guide,Proc Report,我已经在SAS EG 7.2中创建了一个报告,并让SAS在电子邮件正文中发送该报告,但是我似乎无法添加任何文本。我有这个密码: filename mymail email to=('mail@email.com') subject='Report' from='mail@email.com' Content_type="text/h

我已经在SAS EG 7.2中创建了一个报告,并让SAS在电子邮件正文中发送该报告,但是我似乎无法添加任何文本。我有这个密码:

filename mymail email   
                    to=('mail@email.com')
                    subject='Report'
                    from='mail@email.com'
                    Content_type="text/html";

ods _all_  close;
ODS ESCAPECHAR='^'; 
ods html body=mymail  style=minimal;

proc report data=data… 
…
run;

ods html close;
ods _all_ close;
这完美地发送了我的电子邮件。我可以这样做来添加一些文本

filename mymail email   
                        to=('mail@email.com')
                        subject='Report'
                        from='mail@email.com'
                        Content_type="text/html";

ods _all_  close;
ODS ESCAPECHAR='^'; 
ods html body=mymail  style=minimal;

DATA _null_;
file mymail;
Put "Hello,"//
"You are recieving this mail because:"//;
if &warn1=1 then do;
put "&w1." //; end;
if &warn2=1 then do;
put "&w2." //; end;
put
"Regards,"//
"Chris";
run;

ods html close;
ods _all_ close;
但我似乎不能两者兼得?如果我包括文本步骤和过程报告,我只会在生成的电子邮件中看到报告。有什么想法吗


提前感谢:)

如果有人对此感兴趣,我可以通过在proc报告前直接添加以下行来解决此问题:

ods html text="<div>Please find below the Reports </div> <br><br> There are &&totalwarnings. warnings for the last hour:<br><br>";

%if &warn1=1 %then %do;
ods html text="&&w1."; %end;
%if &warn2=1 %then %do;
ods html text="&&w2."; %end;
ods html text=“请在下面的报告中查找

有&&totalwarnings。最近一小时的警告:

”; %如果&warn1=1%,则为%do; ods html text=“&&w1.”;%结束; %如果&warn2=1%,则为%do; ods html text=“&&w2.”;%结束;
将文本添加到HTML文件本身的解决方案听起来最好

您的原始代码有几个问题

首先,您有一个访问冲突。
DATA\u NULL\u
步骤试图写入ODS HTML进程仍在写入的同一文件。你没有收到错误消息吗?或者两封单独的电子邮件

其次,即使您成功地将文本写入ODS HTML生成的同一文件中,它也可能在由ODS HTML生成的报告周围的
标记之前或之后。因此,它可能会被接收者忽略