Hello,
I am using proc means and would like to create a SAS dataset that is exactly the same as the one that appears in the HTML output window. In the past I have been able to pull the table by using a 'ods output' statement within other SAS procedures. In this case it didn't work exactly as planned and I am left with a few questions:
1) When SAS creates the tables for the HTML output, is that dataset already temporarily saved in some physical location? ODS trace says the path is Means.ByGroup1.Summary. However, this isn't quite helpful to me. Is there a full path so I can navigate to that file?
2) If I want to create a separate table for each 'by' group, how do I do this? It seems to me that each table has the same name (Summary). Is there a way I can use the path name to differentiate?
3) Why is it that when I save the table using the code below, the table is formatted differently. I.e. rows and columns have been switched?
ods trace on;
proc means data=h.combined mean median min max var;
by clinic;
ods output summary=summary;
run;
Output Added:
-------------
Name: Summary
Label: Summary statistics
Template: base.summary
Path: Means.ByGroup1.Summary
-------------
NOTE: The above message was for the following BY group:
clinic=AMR
Output Added:
-------------
Name: Summary
Label: Summary statistics
Template: base.summary
Path: Means.ByGroup2.Summary
Add the STACKODS option in your proc means statement.
I don't think you can get separate tables for your BY statements, in general that's not a good idea anyways.
http://support.sas.com/kb/46/427.html
Thanks, that is a helpful option!
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!
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.