****************************************************************************************************
* PROGRAM OVERVIEW
****************************************************************************************************
*
* PROGRAM: create_report.sas
* Created (mm/dd/yyyy): 11/30/2020
*
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the creation of QRP reports
*
* Program inputs:
*
*
* Program outputs:
*
* PARAMETERS:
*
* Programming Notes:
*
*
*--------------------------------------------------------------------------------------------------
* CONTACT INFO:
* Sentinel Coordinating Center
* info@sentinelsystem.org
*
***************************************************************************************************;
%macro create_report();
***************************************************************************************************;
* Initialize global macro variables and read in input files
***************************************************************************************************;
%put =====> MACRO CALLED: create_report;
/* If leave behind report runs then use reportid for log suffix */
%if &leavebehindreport = Y %then %do;
/* Start log */
proc printto log="&output.qrp_report_log&reportid..log" new;
run;
%end;
%else %do;
/* Need to retain work datasets from qrp for leave behind report.
Repdata is set to work directory when leave behind report is run,
and data for qrp report is in the msocdata folder */
proc datasets nowarn nolist lib=work kill; quit;
proc datasets nowarn nolist lib=repdata kill; quit;
proc datasets nowarn nolist lib=msocdata kill; quit;
/*read in JSON file and determine if there are any CSV files*/
%convert_inputfiles(lib=&INFOLDER, JSON_LIB=&infolder.macros/integration);
%convert_inputfiles(lib=&REPORTROOT.inputfiles/, JSON_LIB=&input.macros/integration);
proc printto log="&output.qrp_report_log.log" new;
%end;
/*Initialize global macro variables*/
%initialize_macro_variables();
/*read in input files and process input file parameters*/
%process_inputfiles();
***************************************************************************************************;
* Create concatenated libname for each DP and output DP metadata
***************************************************************************************************;
%createlibref(dplist = &random_dplist.,
dpinfofile = dpinfofile,
dataroot = &dataroot.,
signaturefile =%scan(&runidlist,1)_signature);
%if ^%index(&reporttype,TREE) %then %do;
***************************************************************************************************;
* Assign study start and end dates
***************************************************************************************************;
%output_report_dates();
***************************************************************************************************;
* Create report formats and labels
***************************************************************************************************;
%report_formats_labels();
***************************************************************************************************;
* Baseline tables
***************************************************************************************************;
%baseline_driver();