1

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;
Joe
  • 62,789
  • 6
  • 49
  • 67
Robert Penridge
  • 8,424
  • 2
  • 34
  • 55

1 Answers1

5

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.

Joe
  • 62,789
  • 6
  • 49
  • 67