BookmarkSubscribeRSS Feed
angeliquec
Quartz | Level 8

Hi, I'd like to stack two of my tables in one sheet. Let's say I made a Proc report output for each table, but I'm unable to combine these two tables into 1 sheet, same as attached. Thank you!

 

data table1;
 input text :$20. column1 column2;
 cards;
table_1_counts 6 4
 ;
run;
data table2;
 input text :$20. column1 column2;
 cards;
table_2_counts 6 4
 ;
run;
 
proc report data=table1 out=t1 nowd;
column text column1 column2;
run;
proc report data=table2 out=t2 nowd;
column text column1 column2;
run;
 
2 REPLIES 2
Reeza
Super User
I would suggest combining your original data and use PROC REPORT with a BY statement or GROUP variable and customize the header for each group.
BY is probably easier.
ballardw
Super User

@angeliquec wrote:

Hi, I'd like to stack two of my tables in one sheet. Let's say I made a Proc report output for each table, but I'm unable to combine these two tables into 1 sheet, same as attached. Thank you!

 

data table1;
 input text :$20. column1 column2;
 cards;
table_1_counts 6 4
 ;
run;
data table2;
 input text :$20. column1 column2;
 cards;
table_2_counts 6 4
 ;
run;
 
proc report data=table1 out=t1 nowd;
column text column1 column2;
run;
proc report data=table2 out=t2 nowd;
column text column1 column2;
run;
 

One sheet of what?

 

You don't specify an output destination so we have to assume that the output is HTML which really does not have a concept of "sheet" or "page".

 

Almost certainly your ODS destination would have one or more options that would attempt to place the output on a single "sheet" if specified properly.

 

If using ODS Excel or tagsets.excelxp the likely specifying options(sheet_interval='NONE') would have all of the output on a single sheet.

 

ODS RTF option STARTPAGE=NO would attempt to place all following output on the same page put may not if the tables plus spaces between are too many rows.

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!

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
  • 2724 views
  • 0 likes
  • 3 in conversation