【问题标题】:SAS Conditional row highlighting with ODS and Proc Print使用 ODS 和 Proc Print 突出显示 SAS 条件行
【发布时间】:2013-01-17 23:19:20
【问题描述】:

我想将姓名以“J”开头的人的整行变为红色。这可以使用proc print吗?

ods html file=odsout style=htmlblue ;

proc print data=sashelp.class noobs label;  
  var name age;
run;

ods html close;

【问题讨论】:

    标签: sas sas-ods


    【解决方案1】:

    我认为 PROC PRINT 不可能。 PROC REPORT 可以生成相同的输出,但是行是红色的。

    相同:

    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;
    

    当然,我认为使用样式定义会更简洁一些,但对于一次性的事情,这很容易。

    【讨论】:

    • 谢谢乔。我有一种感觉。
    猜你喜欢
    • 2021-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多