Help using Base SAS procedures

proc report: How to color the row I created w the compute & line statement?

Reply
Regular Contributor
Regular Contributor
Posts: 156

proc report: How to color the row I created w the compute & line statement?

Hi!

in a proc report I create a new row with compute and the line statement. Now I's like to set the background color of this row. However, the call define shows no effect. Here's my code:

proc report mydata;
column mycol1 mycol2;
define mycol1 / group '';
define mycol2 / analysis sum '';

compute after mycol1;
@1 line 'my group heading';
call define(_row_,'style','style={font_weight=bold backgroud=blue}');
endcomp;
run;

Best regards
Eva
SAS Super FREQ
Posts: 8,868

Re: proc report: How to color the row I created w the compute & line statement?

Hi:
Technically, the area created by a LINE statement is controlled by different methods than the _ROW_ method. So you have 2 ways to control the output from a LINE statement:
1) use STYLE(LINES) in a PROC REPORT statement to control the style of all the LINE statement output; or
2) add the style override to your COMPUTE statement which will ONLY impact the LINE output that is contained within that COMPUTE block:
[pre]
compute after mycol1 /
style={font_weight=bold backgroud=blue just=l};
line 'my group heading';
endcomp;
[/pre]

Note also that I removed the @1 in favor of using JUST=L. Generally speaking the use of @ pointer controls rarely results in the output you want. By using @1, I assume you wanted to left-justify your text string.

cynthia
Regular Contributor
Regular Contributor
Posts: 156

Re: proc report: How to color the row I created w the compute & line statement?

Posted in reply to Cynthia_sas
Dear Cynthia,

thanx a lot fpr your great answer - as usual a great inspiration for accumulating knowledge :-)

Best regards
Eva
Ask a Question
Discussion stats
  • 2 replies
  • 114 views
  • 0 likes
  • 2 in conversation