电子邮件 SAS html 输出 [英] Email SAS html output

查看:25
本文介绍了电子邮件 SAS html 输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SAS Enterprise Guide 6.1.我正在尝试使用 Windows 调度程序批处理下面的程序以生成每周报告.它将有一些 proc prints 和 sgplots.我将其发送给的用户是高级用户并且没有 SAS(如果他有的话,他不知道如何处理该程序).理想情况下,我只想通过电子邮件向他发送附件,甚至将图表/结果嵌入电子邮件中,以便他查看.我拥有的程序似乎正确地创建了 html 文件,但是当我在电子邮件中打开它时,sgplots 没有显示.有什么想法吗?谢谢.

I am using SAS Enterprise Guide 6.1. I am trying to batch the program below with windows scheduler to produce a weekly report. It will have a few proc prints and sgplots. The user I am sending it to is high-level and does not have SAS (would not know what to do with the program if he did). Ideally, I'd like to just email him an attachment or even embed the plots/results in the email, so he can view them. The program I have seems to be creating the html file correctly, but when I open it in the email, the sgplots are not displaying. Any thoughts? Thanks.

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;

推荐答案

图表未显示,因为它们对 html 查看器不可用.

The graphs are not showing because they are not available to the html viewer.

选项

  1. 您可以将图像写入可用的位置,并确保生成的 html 中的路径正确.

  1. You could write the images to a place that is available and ensure the paths in the generated html are correct.

生成 PDF 或 RTF 文件并通过电子邮件发送.

Generate a PDF or RTF file and email that.

使用 SVG(可缩放矢量图形).这将需要您解析输出文件并将 SVG 的 XML 嵌入到 HTML 中.

Use SVG (scalable vector graphics). This will require you to parse the output files and embed the XML for the SVG into the HTML.

这篇关于电子邮件 SAS html 输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆