* PROGRAM OVERVIEW
****************************************************************************************************
*
* PROGRAM: create_templatefiles.sas
* Created (mm/dd/yyyy): 12/31/2020
*
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro creates all files that reside in the templatefiles. These are example input files
* that either represent report defaults or can be modified for inclusion in the reporting package
*
* Program inputs:
*
* Program outputs: The following template files are created:
* -TableFile (one file is created per REPORTTTYPE)
* -FigureFile (one file is created per REPORTTYPE)
* -TableColumnsFile
*
* PARAMETERS:
*
* Programming Notes:
*
*
*--------------------------------------------------------------------------------------------------
* CONTACT INFO:
* Sentinel Coordinating Center
* info@sentinelsystem.org
*
***************************************************************************************************;
/*Define libname for location of templatefiles folder*/
libname tempfl "";
%macro create_templatefiles();
*************************************
REPORTTYPE = T1 and T2L1 Files:
- T1TableFile
- T1FigureFile
- T2L1TableFile
- T2L1FigureFile
*************************************;
/*t1cida, t2cida, and t2concomitantuse tables*/
%let stratOneLevel = sex| agegroup| year| year month| year quarter| race| hispanic| zip3| state| zip_uncertain| cb_reg| hhs_reg;
%let stratCovar = &stratOneLevel.| covar#;
%let stratTwoLevel =
sex agegroup| sex agegroup year| sex agegroup year month| sex agegroup year quarter| agegroup year| agegroup year month| agegroup year quarter| sex year| sex year month|
sex year quarter| year month agegroup race| year quarter agegroup race| year month agegroup Hispanic| year quarter agegroup Hispanic| year month sex Hispanic|
year quarter sex Hispanic| year month sex race| year quarter sex race| year month Hispanic race| year quarter Hispanic race|
zip3 zip_uncertain| zip3 sex| zip3 sex zip_uncertain| zip3 agegroup| zip3 agegroup zip_uncertain| zip3 year| zip3 year zip_uncertain|
zip3 race| zip3 race zip_uncertain| zip3 hispanic| zip3 hispanic zip_uncertain|
state zip_uncertain| state sex| state sex zip_uncertain| state agegroup| state agegroup zip_uncertain| state year|
state year zip_uncertain| state race| state race zip_uncertain| state hispanic| state hispanic zip_uncertain|
zip_uncertain sex| zip_uncertain agegroup| zip_uncertain year|
hhs_reg zip_uncertain| hhs_reg sex| hhs_reg sex zip_uncertain| hhs_reg agegroup| hhs_reg agegroup zip_uncertain|
hhs_reg year| hhs_reg year zip_uncertain| hhs_reg race| hhs_reg race zip_uncertain| hhs_reg hispanic| hhs_reg hispanic zip_uncertain|
cb_reg zip_uncertain| cb_reg sex| cb_reg sex zip_uncertain| cb_reg agegroup| cb_reg agegroup zip_uncertain| cb_reg year|
cb_reg year zip_uncertain| cb_reg race| cb_reg race zip_uncertain| cb_reg hispanic| cb_reg hispanic zip_uncertain|
race sex| race agegroup| race year| race year month| race year quarter|
hispanic sex| hispanic agegroup| hispanic year| hispanic year month| hispanic year quarter| year agegroup race| year sex race|
year agegroup hispanic| year sex hispanic| year race hispanic;
%let stratcida = &stratCovar. | &stratTwoLevel.;
%let stratnoCovar = &stratOneLevel. | &stratTwoLevel.;
%macro createt1t2cidatemplates(name);
data lookup_&name.;
retain table dataset tablesub tablesubstrat levelnum levelid1 levelid2 levelid3 includeinreport categories;
format table $5. dataset $15. tablesubstrat $25. tablesub $40. levelid1 levelid2 levelid3 $55. categories $100.;
includeinreport = 'N';
categories = '';
call missing(levelid3);
/*Table T1*/
dataset = "&name.";
table = 'T1';
/*Overall table*/
tablesub = 'overall';
tablesubstrat = '';
levelnum =1;
levelid1 = '';
levelid2 = '';
output;
/*Stratified tables*/
%do i =1 %to %sysfunc(countw(&stratcida., %str(|)));
%let sub = %scan(%str(&stratcida.), &i, '|');
tablesub = "&sub";
tablesubstrat = '';