SAS Conditional row highlighting with ODS and Proc Print

£可爱£侵袭症+ 提交于 2020-01-15 10:11:22

问题


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;

回答1:


I don't believe it's possible with PROC PRINT. PROC REPORT can generate the identical output but with the rows red, however.

Identical:

proc report data=sashelp.class nowd;
columns name age;
run;

With red:

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.



来源:https://stackoverflow.com/questions/14389941/sas-conditional-row-highlighting-with-ods-and-proc-print

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!