The SAS Output Delivery System and reporting techniques

Merging cells in report output for the Group By Values

Reply
Super Contributor
Posts: 268

Merging cells in report output for the Group By Values

Hello,
I have a rather specific requirement. When I use Proc report to group by variables, I get an output that has the cell borders for each of the rows belonging to a group by variables. Is it possible to merge all the cells in Excel and PDF?

If I have this code-

proc report;
column A B C D;
define A / group;
define B / group;
define C / group;
define D / display;
run;

In the output, the cells below each unique value of A and B are blank. I need these cells to merge into 1 cell. Hope my explanation make sense. My diagrams over here dont look good.

Thanks,
saspert
SAS Super FREQ
Posts: 8,743

Re: Merging cells in report output for the Group By Values

Hi:
I'm not sure what you mean when you say that you are using "Proc report to group by variables", since there was no BY statement in your code snippet.

However, if you look at the SPANROWS option (it goes on the PROC REPORT statement), in some destinations, it will cause row spanning, as you describe.
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473620.htm

I know that it will work for PDF. Whether it will work for Excel depends on whether you are using ODS CSV, ODS MSOFFICE2K, or ODS TAGSETS.EXCELXP to create output files that Excel can open.

cynthia
Super User
Posts: 9,681

Re: Merging cells in report output for the Group By Values

Maybe you need to make a computed variable and use cats() function to "need these cells to merge into 1 cell".


Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 299 views
  • 0 likes
  • 3 in conversation