SAS Enterprise Guide

Desktop productivity for business analysts and programmers
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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