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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.