Hi all,
I am trying to use PROC FREQ.
1. I don't want any other information except count (tried using NOROW NOCOL NOPERCENT as well as /LIST).
.
2 In the same step, I also want to output the data to another dataset (output).
proc freq data = abc NOPRINT;
tables xyz/ NOROW NOCOL NOPERCENT out = output ;
RUN;
tables xyz/ out = output1 (drop = percent) / LIST;
I know I am doing some syntax error. Please help.
Thanks,
Archana
Hi. Since you know what you want in data set OUTPUT1, try using KEEP ...
tables xyz/ out=output1 (keep=xyz count);
Also, you're only allowed one slash (/) in the TABLES statement. You can list multiple options after that slash.
Here's an example with a printed table of just counts plus an output data set with just counts ...
proc freq data=sashelp.class;
table age / out=counts (keep=age count) nopercent nocum;
run;
Not too familiar with freq, you could do means though:
proc means data=abc;
var xyz;
output out=out_dataset n=n;
run;
Also remember, you can put:
ods trace one;
Before your freq and see what objects are created, then do;
ods output <object>=<dataset>;
Hi. Since you know what you want in data set OUTPUT1, try using KEEP ...
tables xyz/ out=output1 (keep=xyz count);
Also, you're only allowed one slash (/) in the TABLES statement. You can list multiple options after that slash.
Here's an example with a printed table of just counts plus an output data set with just counts ...
proc freq data=sashelp.class;
table age / out=counts (keep=age count) nopercent nocum;
run;
Thanks a lot MikeZdeb, you answered perfectly
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.