BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DME790
Pyrite | Level 9

Hi All,

 

I have a proc means that creates multiple tables. I use ODS Excel to export it to excel.

When it exports it creates a new tab for each table and I would like all the tables to appear on one worksheet.

 

Or ultimately If I can actually have all the data appear in one table.

 

 

Proc means data=work.acw_abs_baseline median Mean q1 q3 stddev;
By Cluster Queue_cd;
VAR AWT;
Format AWT Comma9.0;
Run;

Current ouput

 

Cluster=ABS Queue Code=ABSa
     
The MEANS Procedure
     
Analysis Variable : AWT
MedianMeanLower
Quartile
Upper
Quartile
Std Dev
107.3750000138.586248058.7692308174.2857143142.0509725

 

 

Like the Output to look like this?  

       
Analysis Variable : AWT
Cluster CodeMedianMeanLower
Quartile
Upper
Quartile
Std Dev
ABS ABSa107.3750000138.586248058.7692308174.2857143142.0509725
ABS ABSb67.0000000121.475424617.6666667143.0000000275.3427533
DSCDSCa251.0000000327.7871022134.0000000421.5000000329.8855516
DSCDSCb226.3333333288.4081027114.0000000387.0000000278.9890103

 

Cheers

 

Dean

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

1. Use ODS EXCEL with the SHEET_INTERVAL='none' option to have all the results on one table.

2. To get a 'simplified' table, run PROC MEANS using the STACKODS option - capture the table and then use PROC PRINT to export the results to your excel file using ODS EXCEL. 

You can either do it before the ODS EXCEL to avoid duplicate output or use ods exclude all to suppress the results.

 

See an example of the STACKODS options here:

http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p17h6q7ygvkl1sn13qzf9...

View solution in original post

3 REPLIES 3
Reeza
Super User

1. Use ODS EXCEL with the SHEET_INTERVAL='none' option to have all the results on one table.

2. To get a 'simplified' table, run PROC MEANS using the STACKODS option - capture the table and then use PROC PRINT to export the results to your excel file using ODS EXCEL. 

You can either do it before the ODS EXCEL to avoid duplicate output or use ods exclude all to suppress the results.

 

See an example of the STACKODS options here:

http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p17h6q7ygvkl1sn13qzf9...

TomKari
Onyx | Level 15

Another option: Use the CLASS statement in PROC MEANS...

 

proc means data=sashelp.class median Mean q1 q3 stddev nway;
class name sex;
var height;
run;
DME790
Pyrite | Level 9

Thanks Tom for your help again.

 

Cheers

 

Dean

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3 replies
  • 4512 views
  • 2 likes
  • 3 in conversation