BookmarkSubscribeRSS Feed
Eva
Quartz | Level 8 Eva
Quartz | Level 8
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
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
Eva
Quartz | Level 8 Eva
Quartz | Level 8
Dear Cynthia,

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

Best regards
Eva

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 837 views
  • 0 likes
  • 2 in conversation