%assign_cohort_mergevar(cohort=preg, mergevar=group, outdata=baselinefile_1, crosscheckfile = cohortfile, crosscheckvar=cohortgrp, includenonpregnant=Y);
****************************************************************************************************
****************************************************************************************************
* PROGRAM: baseline_driver.sas
* Created (mm/dd/yyyy): 11/30/2020
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the creation of L1 and L2 baseline tables (Table 1s)
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro baseline_driver();
%put =====> MACRO CALLED: baseline_driver;
%isdata(dataset=input.&baselinefile.);
%if %eval(&nobs.>0) %then %do;
/* Type 6 baseline tables contain 1 row per switch and these switches need to be included in all 'by' processing*/
%if %str("&reporttype") = %str("T6") %then %do;
%let Switch_s = switchstep;
***********************************************************************************************;
* Create modified baseline dataset with COHORT and MERGEVAR vars to feed into %baseline_aggregate
***********************************************************************************************;
%macro assign_cohort_mergevar(cohort=, mergevar=, outdata=, crosscheckfile = , crosscheckvar = ,includenonpregnant=N);
%if ^%index(&reporttype,T4L1) %then %do;
format cohort mergevar $15. analysisgrp $40. unique_psestimate 3.;