Default PROC FREQ output looks like this:
Suppose you don't want the two cumulative statistic columns above. No problem. Those can be suppressed with the NOCUM option on the TABLE statement, like this:
proc freq data=sashelp.shoes; table product / nocum; run;
Now your output looks like this, but you lose the grand totals.
No problem. Just export to Excel, right?
Sure, Excel can easily total up your columns, but you can just as easily do it in SAS, using this weird trick:
proc freq data=sashelp.shoes; table product / noprint out=mytable; run;
The NORPINT option on the TABLE statement suppresses the PROC FREQ report. Instead, the OUT= option causes PROC FREQ to create an output dataset, WORK.MYTABLE.
proc print data=mytable noobs; sum count percent; run;
Now, print the output dataset from PROC FREQ, using PROC PRINT with a SUM statement to total up the COUNT and PERCENT columns. No need to export to Excel!
Watch the SAS Training Post blog for more weird tricks.