Dear All, I am looking for solution to display Value across column inside the report (like Merge¢er functionality in excel) using proc report . Please find attached file. I would like to display "Total" text across the columns. Any inputs will be appreciated. Thanks
Please show us a portion of the report you asked for via screen capture. Many of us will not download attachments.
Without the basic Proc Report code I would not even attempt to answer this question.
The specific Roles that you assign variables plus any appearance options used might conflict with a given attempted solution.
Better would be to provide an example data set, in the form of data step code plus the Proc Report code, OR use Proc report with a SAS supplied data set like SASHELP.CLASS or similar to create similar report.
Hi @Pankp
As far as I know, I don't think you can merge cells in the summarize line in PROC REPORT like in Excel for example.
However, you can enhance the report output by computing blocks and use a call define statement to alter the cell values and appearances.
E.g.
data have;
input Col1 $ Col2 $ Result1 Result2;
datalines;
A C 1 2
B A 1 2
C B 1 2
;
run;
proc report data=have;
columns Col1 Col2 Result1 Result2 total;
define Col1 / group;
define Col2 / group;
define Result1 / sum;
define Result2 / sum;
define total / computed 'Total';
rbreak after / summarize;
compute total;
total = Result1.sum + Result2.sum;
endcomp;
compute Col1;
if Col1 = "" then do;
Col1 = "Total";
call define (1, 'style', 'style=[borderrightcolor=white]');
end;
endcomp;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.