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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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