%assignlabelvars(format=put(&secondstrat., $&secondstrat.fmt.), sortorder1 = , sortorder2=input(put(&secondstrat., &secondstrat.sort.),1.));
****************************************************************************************************
****************************************************************************************************
* PROGRAM: t5tables_createdata.sas
* Created (mm/dd/yyyy): 08/06/2021
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro produces tables for a Type 5 report
* - agg_t5episdur.sas7bdat
* - 1 dataset per table in the format [TableID]_[StratificationOrder]
* - dataset: aggregate dataset from %aggregate_report_tables
* - whereclause: where clause to restrict input dataset
* - catvar: variable that will be categorized
* - countvar: metric counting counts
* - cattableid: category table ID from TABLEFILE
* - disttableid: distribution table ID from TABLEFILE
* - catvarsort: variable on the input dataset containing category indicators
* - createfootnote: Y/N indicator to create group-specific footnote table (for dose tables)
* - dosevar: name of variable containing statistic names for dosing tables continuous metrics
* - totalcountdosevar: name of variable containing counts for dosing tables continuous metrics
* - Censor tables are computed in a separate macro (censortable_createdata.sas)
* - 'overall' stratification is required for any additional stratification
* - if CATVARSORT is specified, categories have already been computed in QRP, otherwise categories
* must be specified in the TABLEFILE for category tables
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro t5tables_createdata(dataset=,
%put =====> MACRO CALLED: t5tables_createdata ;
/*--------------------------------------------------------------------------------------------*/
/* Determine all levelIDs and stratifications requested */
/*--------------------------------------------------------------------------------------------*/
/*Set &cattableid and &disttableid to missing if not requested*/