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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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