BookmarkSubscribeRSS Feed
zbarnard
Calcite | Level 5
I input my raw data and now I want to use my summary statistics as my new input, so I can further analyze it. How do I do this?
3 REPLIES 3
deleted_user
Not applicable
You have to create output-datasets from your summary statistics. How to actually do it depends on which proc you use, but in general there are two methods used by SAS:

1) the output statement
proc means data = DSN noprint;
var Var1;
output out = DSN_out statistic-keyword= ;
run;

2) the out-option
proc freq data = DSN noprint;
tables Var1 / out = DSN_out;
run;

See SAS documentation for the proc you are going to use / using.
Cynthia_sas
SAS Super FREQ
Hi!
There is a third method:
[pre]
ods output summary=work.msum;
proc means data=sashelp.shoes min mean max;
var sales;
class region;
run;
[/pre]
ODS OUTPUT allows you to capture any ODS output object into a SAS dataset. Most SAS procedures have output objects and you are able to detect the name of the output objects produced by a procedure by using the ODS TRACE statement:
[pre]
ODS TRACE ON /label;
proc means data=sashelp.shoes min mean max;
var sales;
class region;
run;
ODS TRACE OFF;
[/pre]
If you examine the ODS TRACE output in the SAS log, you will see that the name of the output object produced by PROC MEANS is "Summary". The ODS OUTPUT destination is very useful if your item of interest is not output by the output methods shown above OR if your procedure of interest does not support an output or out= method.

Some SAS procedures produce only 1 output object, other SAS procedures produce different output objects based on procedure options and/or BY or CLASS processing or because the procedure itself (like PROC UNIVARIATE) produces multiple output objects in a single run.

Good luck!
cynthia
deleted_user
Not applicable
In your book of the 50 most important things to remember about SAS that you might not often use, this ranks in the first few pages.

Cynthia showed me this in a class a few years ago, and it has been a constant companion, getting me out of trouble with a number of required result sets.

Unlike Cynthia, this doesn't sit at the front of my memory like basic Proc and Data steps, so I highlighted it in my little black book and am grateful every time I have to refresh my memory.

Kind regards

David

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 3 replies
  • 1031 views
  • 0 likes
  • 3 in conversation