【发布时间】:2014-08-12 01:02:43
【问题描述】:
我正在使用 SAS Enterprise Guide 6.1。我正在尝试使用 Windows 调度程序批处理下面的程序以生成每周报告。它将有一些 proc prints 和 sgplots。我将其发送给的用户是高级用户并且没有 SAS(如果他这样做了,将不知道如何处理该程序)。理想情况下,我只想通过电子邮件向他发送附件,甚至将图表/结果嵌入电子邮件中,以便他查看。我拥有的程序似乎正确地创建了 html 文件,但是当我在电子邮件中打开它时,sgplots 没有显示。有什么想法吗?谢谢。
filename temp email to="cthulhu@gmail.com"
subject="Testing the report"
type="text/html"
attach='/sasdata/cthulhu/email.html';
ods html path='/sasdata/cthulhu' file='email.html' gpath='/sasdata/cthulhu' style=htmlblue;
data have;
input name $ class $ time score;
cards;
chewbacca wookie 1 97
chewbacca wookie 2 100
chewbacca wookie 3 95
saruman wizard 1 79
saruman wizard 2 85
saruman wizard 3 40
gandalf wizard 1 22
gandalf wizard 2 50
gandalf wizard 3 87
bieber canadian 1 50
bieber canadian 2 45
bieber canadian 3 10
;
run;
proc sql noprint;
select count(distinct class) into :numclass
from have;
%let numclass=&numclass;
select distinct class into :class1 - :class&numclass
from have;
select count(distinct name) into :numname
from have;
%let numname=&numname;
select distinct name into :name1 - :name&numname
from have;
quit;
%macro printit;
%do i = 1 %to &numclass;
title "Report for &&class&i";
proc print data=have;
where class="&&class&i";
run;
%end;
%mend;
%printit;
%macro plotit;
%do i = 1 %to &numname;
title "Plot for &&name&i";
proc sgplot data=have(where=(name="&&name&i"));
series x=time y=score
/ legendlabel='score' markers lineattrs=(thickness=2);
xaxis label="time";
yaxis label='score';
run;
%end;
%mend;
%plotit;
ods html close;
data _null_;
file temp;
put 'This is a test';
run;
【问题讨论】: