options mprint mlogic;
%macro counts (cols=_all_,rows=,dsn=&syslast);
title "Frequency Counts for %upcase(&dsn) data set";
proc freq data=&dsn;
tables
%if &rows ne %then &rows *
&cols;
%else
&cols;;
run;
%mend counts;
%counts(dsn=sasuser.all, cols=paid, rows=course_number)
%counts(dsn=sasuser.all, cols=paid)