****************************************************************************************************
****************************************************************************************************
* PROGRAM: ms_logchecker.sas
* Created (mm/dd/yyyy): 09/23/2020
*--------------------------------------------------------------------------------------------------
* Reads in the SAS log and checks for concerning lines that may indicate an issue with program execution.
* - Log checker log = log_checker.log
* - SAS dataset = log_checker
* - LogDir = The directory (full path) containing one or more logs to be scanned.
* - LogDir_Out = This is the directory where outputs will be saved.
* - Logname = The name of the specific log file(s) to be scanned, with the ".log" suffix. If specifying more than one log file, separate with a space.
* - Keywords = Additional, user-specified keywords that the tool will scan and report on, separate with a pipe
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro ms_logchecker(logdir =
%put =====> MACRO CALLED: ms_logchecker v1.0;
/*-----------------------------------------------------------------------------------------------------------
Identify log(s) to read in
-----------------------------------------------------------------------------------------------------------*/
/* Capture run date and time */
call symput('curdate',strip(put(date(),worddate.) || ' @' || put(time(),hhmm.)));
/* Search directory for all log files if no log file is specified */
%if "&logname" = "%str()" %then %do;
length filref $8 file_name $80;
rc = filename(filref, "&logdir");