33 %MACRO _reportLogHTML(i_log =
50 %LET l_macname=&sysmacroname;
52 %LET l_html = &o_html;
57 %_checkLog(i_logfile = &l_log
59 ,i_warning = &g_warning.
60 ,r_errors = l_error_count
61 ,r_warnings = l_warning_count
64 %IF %_handleError(&l_macname
67 ,Fehler beim Zugriff auf den Log
68 ,i_verbose=&g_verbose.
75 %LET l_sIgnoreLogMessage01 = %STR(ERROR: Errors printed on page);
79 INFILE
"&l_log" END=eof TRUNCOVER;
81 INPUT logline $char255.;
84 _errorPatternId LENGTH = 8
85 _ignoreErrPatternId LENGTH = 8
86 _warningPatternId LENGTH = 8
87 error_count LENGTH = 8
88 warning_count LENGTH = 8
100 logline = TRANSLATE(logline,
"2F"x,
"18"x);
101 logline = TRANSLATE(logline,
"3B"x,
"0E"x);
102 logline = TRANSLATE(logline,
"2D"x,
"17"x);
103 logline = transtrn(logline,
"08"x, trimn(
''));
104 logline = transtrn(logline,
"06"x, trimn(
''));
105 logline = transtrn(logline,
"01"x, trimn(
''));
106 logline = transtrn(logline,
"02"x, trimn(
''));
107 logline = transtrn(logline,
"0C"x, trimn(
''));
111 _errorPatternId = prxparse(
"/^%UPCASE(&g_error.)[: ]/");
112 _warningPatternId = prxparse(
"/^%UPCASE(&g_warning.)[: ]/");
113 _ignoreErrPatternId = prxparse(
"/^&l_sIgnoreLogMessage01./");
118 PUT
'<meta http-equiv="Content-Language" content="de">';
119 PUT
'<meta name="GENERATOR" content="SAS &sysver">';
120 PUT
'<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">';
121 PUT
"<title>&i_title</title>";
126 PUT
'<p style="background-color:#EAEAEA; font-family:Fixedsys,Courier,monospace">';
127 PUT
"&g_nls_reportLog_001: &l_error_count. ";
128 %DO l_curError = 1 %TO &l_error_count.;
129 IF &l_curError=1 THEN PUT
'==>';
130 PUT
'<a href="#error' "%sysfunc(putn(&l_curError,z3.))" '">' "&l_curError." '</a>';
133 PUT
"&g_nls_reportLog_002: &l_warning_count. ";
134 %DO l_curWarning = 1 %TO &l_warning_count.;
135 IF &l_curWarning=1 THEN PUT
'==>';
136 PUT
'<a href="#warning' "%sysfunc(putn(&l_curWarning,z3.))" '">' "&l_curWarning." '</a>';
144 IF prxmatch (_errorPatternId, logline)
145 AND (NOT prxmatch (_ignoreErrPatternId, logline)) THEN DO;
147 PUT '<span style="color:
#FF0000">' @;
148 PUT
'<a name="error' error_count z3.
'">' @;
150 PUT logline $varying255. l @;
154 ELSE IF prxmatch (_warningPatternId, logline) THEN DO;
156 PUT '<span style="color:
#FF8040">' @;
157 PUT
'<a name="warning' warning_count z3.
'">' @;
159 PUT logline $varying255. l @;
165 DO WHILE (index(logline,
'<') > 0);
166 textpos = index(logline,
'<');
168 newlogline = substr(logline, 1, (textpos - 1)) ||
'<'||substr(logline, (textpos +length(
'<')));
170 newlogline =
'<'||substr(logline, (textpos + length(
'<')));
171 logline = newlogline;
174 DO WHILE (index(logline,
'>') > 0);
175 textpos = index(logline,
'>');
177 newlogline = substr(logline, 1, (textpos - 1)) ||
'>'||substr(logline, (textpos +length(
'>')));
179 newlogline =
'>'||substr(logline, (textpos + length(
'>')));
180 logline = newlogline;
184 PUT logline $varying255. l;
194 %IF %_handleError(&l_macname
197 ,Fehler beim Schreiben der HTML-Datei
198 ,i_verbose=&g_verbose.
202 %IF &l_error_count > 0 %THEN %LET &r_rc = 2;
203 %ELSE %IF &l_warning_count > 0 %THEN %LET &r_rc = 1;
209 %MEND _reportLogHTML;