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!
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.
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;
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
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.
Thanks Reeza.
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;
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 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.