DATA Step, Macro, Functions and more

Pulling HTML Output Table

Reply
Occasional Contributor
Posts: 7

Pulling HTML Output Table

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

 

Super User
Posts: 19,775

Re: Pulling HTML Output Table

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

 

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

 

 

Occasional Contributor
Posts: 7

Re: Pulling HTML Output Table

Thanks, that is a helpful option!

Ask a Question
Discussion stats
  • 2 replies
  • 162 views
  • 0 likes
  • 2 in conversation