Purpose
cstandard study titles


%macro generate_bign(indata=,byvars=,trtcd=armcd,use_byvars=N);
%let bv_sql=%sas_to_sql(list=&byvars);
proc sql noprint;
create table bign_final as
select count(distinct usubjid) as bign,
&trtcd
%if &use_byvars eq Y and %nrbquote(&byvars) ne %nrbquote() %then %do;
,&bv_sql
%end;
from &indata
group by &trtcd
%if &use_byvars eq Y and %nrbquote(&byvars) ne %nrbquote() %then %do;
,&bv_sql
%end;;
%if &use_byvars eq Y and %nrbquote(&byvars) ne %nrbquote() %then %do;
proc sort data=bign_final;
by &byvars;
run;
%end;
proc transpose data=bign_final out=bign_trans prefix=code;
%if &use_byvars eq Y and %nrbquote(&byvars) ne %nrbquote() %then %do;
by &byvars;
%end;
var bign;
id &trtcd;
idlabel &trtcd;
run;

%mend;