Email 使用数据步骤将自定义文本附加到ODS流
我正在尝试打印一个表格到一个电子邮件目的地,然后在最后放一些自定义注释。当我尝试运行下面的代码时,我得到消息:Email 使用数据步骤将自定义文本附加到ODS流,email,sas,sas-ods,Email,Sas,Sas Ods,我正在尝试打印一个表格到一个电子邮件目的地,然后在最后放一些自定义注释。当我尝试运行下面的代码时,我得到消息: ERROR: File is in use, . 我的代码是: filename mymail email content_type="text/html" to=("myemail@myemail.com") from=("myemail@myemail.com")
ERROR: File is in use, .
我的代码是:
filename mymail email content_type="text/html"
to=("myemail@myemail.com")
from=("myemail@myemail.com")
subject="My Report";
ods html3 body=mymail style=sasweb;
proc print data=sashelp.class noobs;
run;
data _null_;
file mymail ;
put "I want this to appear at the bottom of the email.";
run;
ods html3 close;
filename mymail clear;
我曾尝试在谷歌上寻求帮助,但搜索词太模糊,很难将其缩小到这个具体问题。谢谢你的帮助
编辑:只是澄清一下-我希望所有结果都在邮件正文中。我不希望结果作为附件发送。此外,如果您仅注释了上述代码中的数据步骤,则电子邮件工作正常。我无法在实际电子邮件中测试这两种方法,但它们确实避免了(可复制的)
错误:文件正在使用
消息
filename mymail "C:/temp/test.html";
ods html3 body=mymail style=sasweb;
proc print data=sashelp.class noobs;
footnote "Approach 1: I want this to appear at the bottom of the email.";
run;
data _null_;
file print ;
put "Approach 2: I also want this to appear at the bottom of the email.";
run;
ods html3 close;
filename mymail clear;
更改是在数据步骤中使用文件打印
参考。根据报告:
PRINT是一个保留的fileref,它将任何PUT语句生成的输出定向到与SAS过程生成的输出相同的文件。我不清楚您是否真的需要数据步骤来执行任何数据处理,而只是打印文本。我最近遇到了类似的挑战,但我的重点是简单地打印文本,因此您可以使用ODS文本功能: ODS HTML3 text=“方法3:使用ODS文本功能将文本放置在任意位置。” 根据您的html目标,您可以使用css或html标记来控制字体、大小、对齐方式等。我猜您使用html3是为了outlook兼容性,所以css标记不起作用