macro u_ecfreq( edsn = &study.ptinfo, /* dataset name */ ecvr = %str(_all_/list missing), /* variable or list of variables also, can pass cross tables with options */ esub = , /* subset where condition, can also be a format statement */ fnote = /* optional footnotes with ‘\’ delimiter */ ); title1 "Study: &study - Edit Check in &edsn dataset"; title2 "PROC FREQ of %upcase(&ecvr) variable with the condition: &esub"; %if %length(&fnote) > 0 %then %do; %if %index(&fnote,\) = 0 %then footnote3 &fnote.;; %if %index(&fnote,\) > 0 %then %do; %let fnote3=%scan(&fnote,1,\); footnote3 &fnote3; %let fnote4=%scan(&fnote,2,\); footnote4 &fnote4; %end; %end; proc freq data=&edsn; tables &ecvr; &esub; run; footnote3; %mend u_ecfreq;