****************************************************************************************************
****************************************************************************************************
* PROGRAM: create_report.sas
* Created (mm/dd/yyyy): 11/30/2020
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the creation of QRP reports
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
***************************************************************************************************;
* Initialize global macro variables and read in input files
***************************************************************************************************;
/* If leave behind report runs then use reportid for log suffix */
%if &leavebehindreport = Y %then %do;
proc printto log="&output.qrp_report_log&reportid..log" new;
proc printto log="&output.qrp_report_log.log" new;
%put =====> MACRO CALLED: create_report;
/* 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 */
%if &leavebehindreport = N %then %do;
proc datasets nowarn nolist lib=work kill; quit;
proc datasets nowarn nolist lib=repdata kill; quit;
proc datasets nowarn nolist lib=msocdata kill; quit;
/*Initialize global macro variables*/
%initialize_macro_variables();
/*read in input files and process input file parameters*/
***************************************************************************************************;
* Create concatenated libname for each DP and output DP metadata
***************************************************************************************************;
%createlibref(dplist = &random_dplist.,
signaturefile =%scan(&runidlist,1)_signature);
%if ^%index(&reporttype,TREE) %then %do;
***************************************************************************************************;
* Assign study start and end dates
***************************************************************************************************;
***************************************************************************************************;
* Create report formats and labels
***************************************************************************************************;
%report_formats_labels();
***************************************************************************************************;
***************************************************************************************************;
***************************************************************************************************;