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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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