BookmarkSubscribeRSS Feed
ssitharath0420
Quartz | Level 8

I am trying to color the last row to light blue which is my Total Row.

 

Below is my code to create my Proc report:

 

proc report split='~' data=Table3_Final out=Table3_Final_1 spanrows style(header)=[fontweight=bold background=lightblue foreground=black]
style(column)=[font_face='Calibri' fontsize=11pt] style(summary)=[background=lightblue];
column Status P4 P3 P2 P1 C2 C3 C4;
define Status / Display "" style(column)=[cellwidth=25% textalign=center just=decimal];
define P1 / Analysis "&Period_1" style(column)=[cellwidth=25% textalign=center just=decimal];
define P2 / Analysis "&Period_2" style(column)=[cellwidth=25% textalign=center just=decimal];
define P3 / Analysis "&Period_3" style(column)=[cellwidth=25% textalign=center just=decimal];
define P4 / Analysis "&Period_4" style(column)=[cellwidth=25% textalign=center just=decimal];
define C2/ Analysis "C2" style(column)=[cellwidth=25% textalign=center just=decimal];
define C3/ Analysis " C3" style(column)=[cellwidth=25% textalign=center just=decimal];
define C4/ Analysis "C4" style(column)=[cellwidth=25% textalign=center just=decimal];
title1 justify=l 'Title1';
endcomp;
run;

 

3 REPLIES 3
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel as example data we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Some things you need to look at in the posted code and make sure it is what you meant to post.

1) There is nothing creating a summary. I would expect to see some sort of Rbreak after/ summarize; to create a default end of table summary.

2) You have an ENDCOMP without a compute block start which I expect throws an error and generates no output.

BrunoMueller
SAS Super FREQ

Do you mean something like this:

 

proc report data=sashelp.class;
  rbreak after / summarize style=header;
  compute after ;
    name = "Total";
  endcomp;
run;
  • The RBREAK statement allows to specify style information for the "last" row.
  • The COMPUTE AFTER fills the name column with the text "Total";

 

Ksharp
Super User
You need post some dummy data to let us test your code .


proc report data=sashelp.heart nowd;
column bp_status weight height;
define bp_status/group;
define weight/analysis sum;
define height/analysis sum;

compute height;
if bp_status='Optimal' then 
call define(_row_,'style','style={background=verylightblue}');
endcomp;

run;

Ksharp_0-1641816338790.png

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1127 views
  • 1 like
  • 4 in conversation