BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ken_oy
Fluorite | Level 6

In the original SAS program, I could use "ods output" to export some of the results from some Proc procedures, I could make those p-values from t-tests, or means or SDs into a new data sets

For example:

ods output "Summary statistics"=means;

proc means data=meg1 mean stderr q1 q3;

class num velocity;

var p;

run;

ods output close;

In this step I can export the Proc means result in to dataset "means". I could see "Summary statistics" was listed on the left side for the SAS program "Result" window, so I could use the ODS OUTPUT statement to export it into a new data set.

But in SAS enterprise guide there is no such "result" window, how can I do it? How to export procedure results into new datasets?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
esjackso
Quartz | Level 8

I see the issue now.

There are a couple of ways to find the "ODS Name" for the printed output. I usual just use the place ods trace on; and ods trace off; around the procedure code im coverting to a dataset. This will place in the log some added information regarding the procedure. The label in the output added section is the keyword to use to select the piece of output for the dataset. If the procedure has multiple pieces like reg, glm, logistics, etc in the output there will be a group describing each each allowing you to select the section you want in the dataset.

AS AN Example:

ods trace on;

ods output "Summary Statistics" = means;

proc means data= sashelp.class mean;

class sex;

var age;

run;

ods output clear;

ods trace off;

FROM THE LOG:

Output Added:

-------------

Name:        Summary

Label:         Summary statistics

Template:   base.summary

Path:          Means.Summary

-------------

Additional most of the procs Ive used with this has a section in the SAS documentation the lists this information as well. Of course I find it easier to use the code than scroll through the documentation.

EJ

View solution in original post

4 REPLIES 4
esjackso
Quartz | Level 8

I dont think it works any differently in EG. If you write the same code in EG the dataset will appear in the work directory just as in the Display Manager version of SAS (regular SAS). I just tried it and it acted as what Im used to in regular SAS.

Have you tried the code in EG? Did you get an error that you can post?

EJ

Ken_oy
Fluorite | Level 6

Hi, esjackso1. Sorry that I did not myself clear.

I did try the same code in EG, and it worked well.

My question is: How can I know the name for the procedure result, (for example "Summary statistics" in PROC MEANS).

In the regular SAS I can look this up from the left "result" window. but in EG I don't know where I can find the procedure result name that I can use for the ODS OUTPUT statement. I couldn't always remember all those procedure result names.

Thanks Smiley Happy

Reeza
Super User

In the documentation for SAS, there's usually under details the ODS Table Names:

So you do need to know the proc you're looking for, but other than that can look it up.

Base SAS(R) 9.3 Procedures Guide: Statistical Procedures, Second Edition

Also, many EG Procs have an option to create an output dataset with the details stored, you just need to check the right box Smiley Happy

esjackso
Quartz | Level 8

I see the issue now.

There are a couple of ways to find the "ODS Name" for the printed output. I usual just use the place ods trace on; and ods trace off; around the procedure code im coverting to a dataset. This will place in the log some added information regarding the procedure. The label in the output added section is the keyword to use to select the piece of output for the dataset. If the procedure has multiple pieces like reg, glm, logistics, etc in the output there will be a group describing each each allowing you to select the section you want in the dataset.

AS AN Example:

ods trace on;

ods output "Summary Statistics" = means;

proc means data= sashelp.class mean;

class sex;

var age;

run;

ods output clear;

ods trace off;

FROM THE LOG:

Output Added:

-------------

Name:        Summary

Label:         Summary statistics

Template:   base.summary

Path:          Means.Summary

-------------

Additional most of the procs Ive used with this has a section in the SAS documentation the lists this information as well. Of course I find it easier to use the code than scroll through the documentation.

EJ

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1060 views
  • 1 like
  • 3 in conversation