****************************************************************************************************
****************************************************************************************************
* PROGRAM: t5tables_output.sas
* Created (mm/dd/yyyy): 08/25/2021
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro includes two proc report procedures in order to produce a categorical and
* continuous table in the report for Type 5 analyses
* - Dataset(s) computed in %t5tables_createdata
* - Dataset(s) to output/repdata for each figure
* - dataset: input dataset
* - report: indicator whether to produce categorical (1) or continuous (2) metrics
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro t5tables_output(dataset=,
%put =====> MACRO CALLED: t5tables_output;
%if &labelfileexists. = Y %then %do;
set labelfile(where=(labeltype='header'));
%isdata(dataset=headerlabelyes);
data repdata.table&tablenum.&tableletter.;
%if %eval(&nobs.>0) %then %do;
if missing(header)=0 then call symputx('header','header');
proc datasets nowarn noprint lib=work;
data repdata.table&tablenum.&tableletter.;
select max(sortorder1), max(sortorder2)