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 | ||||
Median | Mean | Lower Quartile | Upper Quartile | Std Dev |
107.3750000 | 138.5862480 | 58.7692308 | 174.2857143 | 142.0509725 |
Like the Output to look like this?
Analysis Variable : AWT | ||||||
Cluster | Code | Median | Mean | Lower Quartile | Upper Quartile | Std Dev |
ABS | ABSa | 107.3750000 | 138.5862480 | 58.7692308 | 174.2857143 | 142.0509725 |
ABS | ABSb | 67.0000000 | 121.4754246 | 17.6666667 | 143.0000000 | 275.3427533 |
DSC | DSCa | 251.0000000 | 327.7871022 | 134.0000000 | 421.5000000 | 329.8855516 |
DSC | DSCb | 226.3333333 | 288.4081027 | 114.0000000 | 387.0000000 | 278.9890103 |
Cheers
Dean
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:
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:
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;
Thanks Tom for your help again.
Cheers
Dean
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.