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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1121 views
  • 0 likes
  • 2 in conversation