SAS 条件行突出显示与 ODS 和 Proc Print [英] SAS Conditional row highlighting with ODS and Proc Print
本文介绍了SAS 条件行突出显示与 ODS 和 Proc Print的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于名字以J"开头的人,我想将整行变成红色.这可以使用 proc print
吗?
I want to turn the entire row red for people whose names begin with 'J'. Is this possible using proc print
?
ods html file=odsout style=htmlblue ;
proc print data=sashelp.class noobs label;
var name age;
run;
ods html close;
推荐答案
我不认为 PROC PRINT 是可行的.PROC REPORT 可以生成相同的输出,但行是红色的.
I don't believe it's possible with PROC PRINT. PROC REPORT can generate the identical output but with the rows red, however.
相同:
proc report data=sashelp.class nowd;
columns name age;
run;
红色:
proc report data=sashelp.class nowd;
columns name age;
compute name;
if substr(name,1,1)='J' then
call define(_row_, "style", "style=[backgroundcolor=red]");
endcomp;
run;
当然,我认为使用样式定义会更简洁一些,但对于一次性的事情,这很容易.
I would consider it somewhat cleaner to use a style definition of course but for a one-off sort of thing this is easy.
这篇关于SAS 条件行突出显示与 ODS 和 Proc Print的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文