****************************************************************************************************
****************************************************************************************************
* PROGRAM: process_inputfiles.sas
* Created (mm/dd/yyyy): 11/30/2020
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro reads in the CREATEREPORTFILE and other input files and merges in relevant
* QRP input file parameter values
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro process_inputfiles();
%put =====> MACRO CALLED: process_inputfiles ;
/***************************************************************************************************
* Read in CREATEREPORTFILE and assign each parameter to a macro variable
***************************************************************************************************/
%isdata(dataset=input.&createreportfile.);
%if %eval(&nobs<1) %then %do;
%put ERROR: (Sentinel) CREATEREPORTFILE is missing.;
%put ERROR: (Sentinel) Make sure file is specified correctly and placed in the inputfiles folder;
* Check if createreportfile has horizontal structure;
proc contents data=input.&createreportfile. noprint out=createreportfile_content;
%let parameter_variable_exists=0;
select count(*) into :parameter_variable_exists from createreportfile_content
where lowcase(name)="parameter";
%put &=parameter_variable_exists;
/* createreportfile has vertical structure */
%if ¶meter_variable_exists. > 0 %then %do;
set input.&createreportfile.;
/* createreportfile has horizontal structure */