- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
How to store in output table or dataset for given below proc freq results.
proc freq data=source1;
run;
Note: I want to store proc freq results for all the columns which are in source1 dataset.
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This example shows you how to get a nice clean table. Just change replace your proc freq with mine and you should get the output wanted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the OUT= option of the TABLES statement.
If you really don't want to use the TABLES statement, then you can use
ODS OUTPUT ONEWAYFREQS=FREQS;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
However, given below statement does not work. I want to keep freq results for all the columns in output dataset.
proc freq data=source1;
tables _all_ / out=freq_results;
run
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This example shows you how to get a nice clean table. Just change replace your proc freq with mine and you should get the output wanted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Reeza.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What type of output do you want? If you want a single dataset that has checker board pattern of missing values you can either use the ODS output data or use PROC SUMMARY.
Run this to see what the results look like so a small test dataset.
data test;
set sashelp.class (obs=5);
keep name age height ;
run;
proc print data=test;
run;
ods exclude ONEWAYFREQS;
ods output ONEWAYFREQS=want1;
proc freq data=test;
run;
ods exclude none;
proc print data=want1; run;
proc summary data=test chartype ;
class _all_;
ways 1;
output out=want2;
run;
proc print data=want2;
run;