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

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

问题描述

我正在使用SAS Enterprise Guide 6.1。我正在尝试使用Windows调度程序对以下程序进行批处理以生成每周报告。它将有几个proc打印和sgplots。我要发送给用户的是高级用户,并且没有SAS(如果他这么做,他不知道如何处理该程序)。理想情况下,我只想给他发一封附件,甚至在电子邮件中嵌入情节/结果,以便他可以查看它们。我的程序似乎正在创建html文件,但是当我在电子邮件中打开它时,sgplots不显示。有什么想法吗?

  filename temp email to =cthulhu@gmail.com
subject =测试报告
type =text / html
attach ='/ sasdata / cthulhu / email.html';

ods html path ='/ sasdata / cthulhu'file ='email.html'gpath ='/ sasdata / cthulhu'style = htmlblue;

数据有;
输入名称$ class $时间分数;
卡;
chewbacca wookie 1 97
chewbacca wookie 2 100
chewbacca wookie 3 95
saruman巫师1 79
saruman巫师2 85
saruman巫师3 40
gandalf向导1 22
甘道向导2 50
甘道向导3 87
加拿大人1 50
加拿大人2 45
加拿大人3 10
;
跑;

proc sql noprint;
select count(distinct class)into:numclass
from have;
%let numclass =& numclass;
将不同的类选择为:class1 - :class& numclass
from have;
select count(distinct name)into:numname $ b $ from have;
%let numname =& numname;
将不同的名称选择为:name1 - :name& numname $ b $ from have;
退出;

%macro printit;
%do i = 1%到& numclass;
titleReport&& class& i;
proc print data = have;
where class =&& class& i;
跑;
%end;
%修正;
%printit;

%宏观剧情;
%do i = 1%到& numname;
titlePlot for&& name& i;
proc sgplot data = have(where =(name =&& name& i));
系列x =时间y =分数
/ legendlabel ='分数'标记lineattrs =(thickness = 2);
xaxis label =time;
yaxis label ='分数';
跑;
%end;
%修正;
%plotit;

ods html close;

data _null_;
文件临时文件;
放'这是一个测试';
跑;


解决方案

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



选项


  1. 您可以将图片写入一个地方是可用的,并确保生成的HTML路径是正确的。


  2. 生成PDF或RTF文件并发送邮件。 b $ b

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



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;

解决方案

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

Options

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

  2. Generate a PDF or RTF file and email that.

  3. 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天全站免登陆