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!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: