25 %MACRO _reportDetailHTML (i_repdata =
34 l_nls_reportdetail_errors
47 %LET l_nls_reportdetail_errors = %STR(error(s));
50 select count (distinct tst_type) into :_numAsserts from &i_repdata. where scn_id = &i_scnid AND tst_type ne
'^_'; * AND cas_id = &i_casid;
51 select count (distinct cas_id) into :_numCases from &i_repdata. where scn_id = &i_scnid AND tst_type ne
'^_'; * AND cas_id = &i_casid;
54 %
if (&_numAsserts. > 0) %then %
do;
55 %
do l_NumAssert=1 %to &_numAsserts.;
56 %local assertType&l_NumAssert.
61 select distinct tst_type into :assertType1-:assertType%cmpres(&_numAsserts.) from &i_repdata. where scn_id = &i_scnid AND tst_type ne '^_'; * AND cas_id = &i_casid;
64 DATA work._test_report;
65 SET &i_repdata. END=eof;
66 WHERE scn_id = &i_scnid;
69 scn_abs_path cas_abs_path $256
83 scnDescriptionColumn casDescriptionColumn descriptionColumn $1000
84 scnProgramColumn casProgramColumn $1000
85 scnLast_runColumn casLast_runColumn $1000
86 scnDurationColumn $1000
93 scnDescriptionColumn="&g_nls_reportDetail_029."
94 scnProgramColumn ="&g_nls_reportDetail_030."
95 scnLast_runColumn ="&g_nls_reportDetail_031."
96 scnDurationColumn ="&g_nls_reportDetail_032."
97 casDescriptionColumn="&g_nls_reportDetail_034."
98 casProgramColumn ="&g_nls_reportDetail_035."
99 casLast_runColumn ="&g_nls_reportDetail_031."
100 idColumn ="&g_nls_reportDetail_009."
101 assertTypeColumn ="&g_nls_reportDetail_010."
102 descriptionColumn ="&g_nls_reportDetail_011."
103 expectedColumn ="&g_nls_reportDetail_012."
104 actualColumn ="&g_nls_reportDetail_013."
105 resultColumn ="&g_nls_reportDetail_014."
108 *** initalizing variables that MAY be used in a specific assert ***;
119 if tst_act="" then tst_act='^_';
120 if tst_exp="" then tst_exp='^_';
122 *** Columns for scenario overview ***;
123 scn_abs_path = resolve ('%_abspath(&g_root,' !! trim(scn_path) !! ')');
124 scn_pgm = resolve ('%_stdpath(&g_root./saspgm/test,' !! trim(scn_abs_path) !! ')');
125 scn_duration = put (scn_end - scn_start, ??&g_nls_reportScn_013.) !! " s";
126 c_scnid = put (scn_id, z3.);
127 c_casid = put (cas_id, z3.);
128 if (cas_auton = 0) then do;
129 cas_abs_path = resolve ('%_abspath(&g_sasunit,' !! trim(cas_pgm) !! ')');
131 else if (cas_auton = 1) then do;
132 cas_abs_path = resolve ('%_abspath(&g_sasunit_os,' !! trim(cas_pgm) !! ')');
135 cas_abs_path = resolve ('%_abspath(&g_sasautos' !! put (cas_auton-2,1.) !! ',' !! trim(cas_pgm) !! ')');
137 cas_pgm = resolve ('%_stdpath(&g_root./saspgm/,' !! trim(cas_abs_path) !! ')');
139 %_render_DataColumn (i_sourceColumn=scn_duration
140 ,o_targetColumn=scnDurationColumn
142 %_render_DataColumn (i_sourceColumn=cas_desc
143 ,o_targetColumn=casDescriptionColumn
145 %_render_DataColumn (i_sourceColumn=tst_desc
146 ,o_targetColumn=descriptionColumn
148 %_render_DataColumn (i_sourceColumn=tst_type
149 ,o_targetColumn=assertTypeColumn
151 %_render_IconColumn (i_sourceColumn=tst_res
153 ,o_targetColumn=resultColumn
156 *** Any destination that renders links shares this if ***;
157 %if (&o_html.) %then %do;
158 LinkTitle1 = trim ("&g_nls_reportDetail_003") !!" " !! c_scnid;
159 LinkTitle2 = "&g_nls_reportDetail_004" !! byte(13) !! scn_abs_path;
160 LinkTitle3 = "&g_nls_reportDetail_005";
161 LinkTitle4 = "&g_nls_reportDetail_006" !! byte(13) !! cas_abs_path;
162 LinkTitle5 = "&g_nls_reportDetail_007";
163 *** HTML-links are destinations specific ***;
164 %if (&o_html.) %then %do;
165 LinkColumn1 = catt("cas_overview.html
#SCN", c_scnid, "_");
166 LinkColumn2 =
"pgm_" !! tranwrd (scn_pgm,
".sas",
".html");
167 LinkColumn3 = c_scnid !!
"_log.html";
168 LinkColumn4 =
"pgm_" !! tranwrd (cas_pgm,
".sas",
".html");
169 LinkColumn5 = c_scnid !!
"_" !! c_casid !!
"_log.html";
171 %_render_DataColumn (i_sourceColumn=scn_desc
172 ,o_targetColumn=scnDescriptionColumn
173 ,i_linkColumn=LinkColumn1
174 ,i_linkTitle=LinkTitle1
176 %_render_DataColumn (i_sourceColumn=scn_path
177 ,i_linkColumn=scn_abs_path
178 ,i_linkTitle=LinkTitle2
179 ,o_targetColumn=scnProgramColumn
181 %_render_DataColumn (i_sourceColumn=scn_start
182 ,i_format=&g_nls_reportDetail_050.
183 ,i_linkColumn=LinkColumn3
184 ,i_linkTitle=LinkTitle3
185 ,o_targetColumn=scnLast_runColumn
187 %_render_DataColumn (i_sourceColumn=cas_pgm
188 ,i_linkColumn=cas_abs_path
189 ,i_linkTitle=LinkTitle4
190 ,o_targetColumn=casProgramColumn
192 %_render_DataColumn (i_sourceColumn=cas_start
193 ,i_format=&g_nls_reportDetail_050.
194 ,i_linkColumn=LinkColumn5
195 ,i_linkTitle=LinkTitle5
196 ,o_targetColumn=casLast_runColumn
198 idColumn =
"^{style [PRETEXT=""<a name='TST" !! put (tst_id, z3.) !!
"'></a>""]" !! put (tst_id, z3.) !!
"}";
201 %
do l_NumAssert=1 %to &_numAsserts;
202 if (upcase(tst_type)=
"%upcase(&&asserttype&l_NumAssert.)") then
do;
203 %let l_NumAssertSubstr = &&asserttype&l_NumAssert.;
204 %
if (%length(&l_NumAssertSubstr.) > 21) %then %
do;
205 %let l_NumAssertSubstr = %substr(&l_NumAssertSubstr.,1,21);
207 %_render_&l_NumAssertSubstr.Exp (i_sourceColumn=tst_exp
209 ,o_targetColumn=expectedColumn
211 %_render_&l_NumAssertSubstr.Act (i_sourceColumn=tst_act
213 ,o_targetColumn=actualColumn
219 %*** Reset title and footnotes ***;
223 %
do i_cas=1 %to &_numCases.;
224 %let l_title=%str(&g_nls_reportCas_001. | &g_project - &g_nls_reportCas_002.);
225 title j=c
"&l_title.";
226 %
if (&o_html.) %then %
do;
227 ods html4 file=
"&o_path./&o_file._%sysfunc (putn (&i_cas., z3.)).html"
229 headtext=
'<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />'
230 metatext=
"http-equiv=""Content-Style-Type"" content=""text/css"" /><meta http-equiv=""Content-Language"" content=""&i_language."" /"
231 style=styles.SASUnit stylesheet=(URL=
"css/SAS_SASUnit.css")
232 encoding=
"&g_rep_encoding.";
233 %_reportPageTopHTML(i_title = &l_title.
237 %LET l_c_scnid = %substr(00&i_cas.,%length(&i_cas));
239 *** Reset title and footnotes
for each Testcase ***;
240 *** First print should contain title but no footnotes ***;
244 data work._test_overview;
245 set work._test_report (where=(tst_id=1 AND cas_id=&i_cas.));
246 length Name $20 Value $1000;
247 Name=
"&g_nls_reportDetail_028."; Value=c_scnid;output;
248 Name=
"&g_nls_reportDetail_029."; Value=scnDescriptionColumn;output;
249 Name=
"&g_nls_reportDetail_030."; Value=scnProgramColumn;output;
250 Name=
"&g_nls_reportDetail_031."; Value=scnLast_runColumn;output;
251 Name=
"&g_nls_reportDetail_032."; Value=scnDurationColumn;output;
252 Name=
"&g_nls_reportDetail_033."; Value=c_casid;output;
253 Name=
"&g_nls_reportDetail_034."; Value=casDescriptionColumn;output;
254 Name=
"&g_nls_reportDetail_035."; Value=casProgramColumn;output;
255 Name=
"&g_nls_reportDetail_031."; Value=casLast_runColumn;output;
259 proc print data=work._test_overview noobs label
260 style(report)=blindTable [borderwidth=0]
261 style(column)=blindData
262 style(header)=blindHeader;
265 *** Second print should contain no title but footnotes ***;
267 %_reportFooter(o_html=&o_html.);
269 proc report data=work._test_report (where=(cas_id=&i_cas.)) nowd missing
270 style(lines)=blindData
273 columns idColumn assertTypeColumn descriptionColumn expectedColumn actualColumn resultColumn;
275 define idColumn / order style(Column)=rowheader;
276 define resultColumn / display style(Column)=[background=white];
278 compute before _page_;
279 line @1
"&g_nls_reportDetail_008.";
284 %
if (&o_html.) %then %
do;
288 %*** Reset title and footnotes ***;
294 %
do l_NumAssert=1 %to &_numAsserts;
295 *** Call all associated submacros
for rendering specific assert reports ***;
296 %let l_NumAssertSubstr = %lowcase(&&asserttype&l_NumAssert.);
297 %
if (%length(&l_NumAssertSubstr.) > 21) %then %
do;
298 %let l_NumAssertSubstr = %substr(&l_NumAssertSubstr.,1,21);
300 %
if (%sysfunc (fileexist(&g_sasunit./_render_&l_NumAssertSubstr.rep.sas))) %then %
do;
302 select count(distinct cas_id) into :_numCases from work._test_report where tst_type =
"&&asserttype&l_NumAssert.";
303 select distinct cas_id into :l_casids separated by
"§" from work._test_report where tst_type =
"&&asserttype&l_NumAssert.";
305 %
do i_cas=1 %to &_numCases.;
306 %LET l_casid = %scan (&l_casids., &i_cas., §);
307 %LET l_c_casid = %substr(00&l_casid.,%length(&l_casid));
309 select count(*) into :l_NumTests from work._test_report where tst_type = "&&asserttype&l_NumAssert." AND cas_id=&l_casid.;
310 select tst_id into :l_Tests separated by "§" from work._test_report where tst_type = "&&asserttype&l_NumAssert." AND cas_id=&l_casid.;
312 %do l_TestAssert=1 %to &l_NumTests.;
313 %LET l_cTestAssert = %scan(&l_Tests.,&l_TestAssert.,§);
314 %_render_&l_NumAssertSubstr.rep(i_assertype=&&asserttype&l_NumAssert.,i_repdata=&i_repdata.,i_scnid=&i_scnid.,i_casid=&l_c_casid.,i_tstid=&l_cTestAssert.,o_html=&o_html.,o_path=&o_path.);
320 proc datasets lib=work nolist memtype=(view data);
321 delete _test_overview _test_report;
324 %MEND _reportDetailHTML;