BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9
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
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
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
Ksharp
Super User
Maybe you need to make a computed variable and use cats() function to "need these cells to merge into 1 cell".


Ksharp

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1863 views
  • 0 likes
  • 3 in conversation