BookmarkSubscribeRSS Feed
mmea
Quartz | Level 8

Hi I have this code for a proc report;

 


proc report data=data style(header) = {background = white color = black};
	    columns year week COUNT ;
	    define year/  group style(column)= [background = white font_size=10pt font_weight = bold] style(header) = {background = white frame=void};
		compute after year / style={bordertopcolor=black borderbottomcolor=black height=1px cellpadding=0};
        line ' '; 
        endcomp;
	    define week/  group style(column)= [background = white font_size=8pt] style(header) = {background = white frame=void} ;
		define COUNT/  group style(column)= [background = white font_size=8pt] style(header) = {background = white frame=void};	run;

This give me this kind of table (without the total):

 

Year week count
2020 1 1
  2 3
  3 4
  4 1
2021 1 1
  2 1
  3 1
Total   12

 

I need a total at the end of the table (as shown in the table in bold) - how can I add that? I export to Excel 🙂

1 REPLY 1
andreas_lds
Jade | Level 19

You can find the documentation of proc report here.

The rbreak statement is used to create summary lines.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 421 views
  • 0 likes
  • 2 in conversation