Not sure if that helps anyone, but I, inspired by the paper wrote something which i think is slightly more robust at picking up errors: /* USAGE: %de_log(full-file-path); EXAMPLE: %de_log(c:\temp\saved_log.log); */ %macro de_log(logfile); option nomprint; filename log "&logfile"; data de_log_output (drop=line_txt); retain nline 0; length line_txt FULL_TEXT $ 1000 TYPE $ 10 SUB_TYPE $ 100; infile infl lrecl=200 pad; input @; nline+1; if substr(_infile_, 1, 5) = "ERROR" or substr(_infile_, 1, 7) = "WARNING" or substr(_infile_, 1, 4) = "NOTE" then do; line_txt = _infile_; if substr(_infile_, length(_infile_), 1) ne '2E'x then do; line_txt = _infile_; do while (substr(_infile_, length(_infile_), 1) ne '2E'x); input /@; line_txt=catx(" ", line_txt, _infile_); end; end; else do; line_txt =_infile_; end; /*exclude non-error notes*/ if substr(line_txt, 1, 4) = "NOTE" and (index(line_txt, 'The data set')=0 or index(line_txt, 'has 0 observations')=0) then delete; /*define type and subtype*/ TYPE = compress(scan(line_txt, 1, " "), ":"); if index(line_txt, ",") and not(index(line_txt, "DROP,")) then do; SUB_TYPE = substr(scan(line_txt, 1, ","), index(line_txt, ":") +2); end; else if index(line_txt, "0 observations") then do; SUB_TYPE = "Incomplete dataset (obs=0)"; end; else if index(line_txt, "Multiple lengths were specified for the BY variable") then do; SUB_TYPE = "BY variables have inconsistent LENGTHS"; end; else if index(line_txt, "The quoted string currently being processed") then do; SUB_TYPE = "Unbalanced quote marks?"; end; else if index(line_txt, "Invalid data set name") then do; SUB_TYPE = "No / invalid dataset name"; end; else if index(line_txt, "has never been referenced") then do; SUB_TYPE = "Keeping, dropping or renaming non-existent variable"; end; else SUB_TYPE = "Other"; FULL_TEXT = line_txt; output; end; run; proc sort data=de_log_output; by TYPE SUB_TYPE; run; proc summary data=de_log_output noprint nway n; class TYPE SUB_TYPE; output out=de_log_summary (drop=_TYPE_); run; option mprint; %mend de_log;
... View more