28 %MACRO _sasunit_reportLogHTML(
35 %LOCAL l_macname; %LET l_macname=&sysmacroname;
39 %LET l_html = &o_html;
55 ,i_warning = &g_warning.
56 ,r_errors = l_error_count
57 ,r_warnings = l_warning_count
60 %IF %_sasunit_handleError(&l_macname, LogNotFound,
62 Fehler beim Zugriff auf den Log)
68 %LET l_sIgnoreLogMessage01 = %STR(ERROR: Errors printed on page);
72 INFILE
"&l_log" END=eof TRUNCOVER;
74 INPUT logline $char255.;
77 _errorPatternId LENGTH = 8
78 _ignoreErrPatternId LENGTH = 8
79 _warningPatternId LENGTH = 8
80 error_count LENGTH = 8
81 warning_count LENGTH = 8
93 _errorPatternId = prxparse(
"/^%UPCASE(&g_error.)[: ]/");
94 _warningPatternId = prxparse(
"/^%UPCASE(&g_warning.)[: ]/");
95 _ignoreErrPatternId = prxparse(
"/^&l_sIgnoreLogMessage01./");
100 PUT
'<meta http-equiv="Content-Language" content="de">';
101 PUT
'<meta name="GENERATOR" content="SAS &sysver">';
102 PUT
'<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">';
103 PUT
"<title>&i_title</title>";
108 PUT
'<p style="background-color:#EAEAEA; font-family:Fixedsys,Courier,monospace">';
109 PUT
"&g_nls_reportLog_001: &l_error_count. ";
110 %DO l_curError = 1 %TO &l_error_count.;
111 IF &l_curError=1 THEN PUT
'==>';
112 PUT
'<a href="#error' "%sysfunc(putn(&l_curError,z3.))" '">' "&l_curError." '</a>';
115 PUT
"&g_nls_reportLog_002: &l_warning_count. ";
116 %DO l_curWarning = 1 %TO &l_warning_count.;
117 IF &l_curWarning=1 THEN PUT
'==>';
118 PUT
'<a href="#warning' "%sysfunc(putn(&l_curWarning,z3.))" '">' "&l_curWarning." '</a>';
126 IF prxmatch (_errorPatternId, logline)
127 AND (NOT prxmatch (_ignoreErrPatternId, logline)) THEN DO;
129 PUT '<span style="color:
#FF0000">' @;
130 PUT
'<a name="error' error_count z3.
'">' @;
132 PUT logline $varying255. l @;
136 ELSE IF prxmatch (_warningPatternId, logline) THEN DO;
138 PUT '<span style="color:
#FF8040">' @;
139 PUT
'<a name="warning' warning_count z3.
'">' @;
141 PUT logline $varying255. l @;
147 DO WHILE (index(logline,
'<') > 0);
148 textpos = index(logline,
'<');
150 newlogline = substr(logline, 1, (textpos - 1)) ||
'<'||substr(logline, (textpos +length(
'<')));
152 newlogline =
'<'||substr(logline, (textpos + length(
'<')));
153 logline = newlogline;
156 DO WHILE (index(logline,
'>') > 0);
157 textpos = index(logline,
'>');
159 newlogline = substr(logline, 1, (textpos - 1)) ||
'>'||substr(logline, (textpos +length(
'>')));
161 newlogline =
'>'||substr(logline, (textpos + length(
'>')));
162 logline = newlogline;
166 PUT logline $varying255. l;
176 %IF %_sasunit_handleError(&l_macname, ErrorWriteHTML,
178 Fehler beim Schreiben der HTML-Datei)
181 %IF &l_error_count > 0 %THEN %LET &r_rc = 2;
182 %ELSE %IF &l_warning_count > 0 %THEN %LET &r_rc = 1;
188 %MEND _sasunit_reportLogHTML;