****************************************************************************************************
****************************************************************************************************
* PROGRAM: t6censor_output.sas
* Created (mm/dd/yyyy): 10/22/2021
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the creation of T6 Censoring tables
* - repdata.&tablenum.&tableletter
* - tablenum - Table Number and letter
* - dataset - T6 censoring dataset
* - censorreason - List of censoring reasons
* - dptable - Determine whether to use dpidsiteid column
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro t6censor_output(tablenum=,dataset=,title=,reasonlist=,where=,dptable=);
set lookup.lookup_footnotes(where = (type = "censor" and order in (1
%if %index(&reasonlist.,cens_episend) %then %do; 4 %end;
%if %index(&reasonlist.,cens_event) %then %do; 5 %end;
%if %index(&reasonlist.,cens_spec) %then %do; 6 %end;
%if %index(&reasonlist.,cens_dth) %then %do; 7 %end;
%if %index(&reasonlist.,cens_elig) %then %do; 8 %end;
%if %index(&reasonlist.,cens_dpend) %then %do; 9 %end;
%if %index(&reasonlist.,cens_qryend) %then %do; 10 %end;
%if %index(&reasonlist.,cens_switch) and &dataset=tableT9 %then %do; 11 %end;
%if %index(&reasonlist.,cens_switch) and &dataset=tableT10 %then %do; 12 %end;)));
select count(order) into: num_fn trimmed
%if %eval(&num_fn.>0) %then %do;
select description into: fn1 - :fn&num_fn.