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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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