24 %MACRO _reportAutonHTML (i_repdata =
32 %LOCAL d_rep1 d_rep2 l_tcg_res l_pgmLibraries l_pgmLib l_title l_logpath l_cAuton;
34 %_tempFileName(d_rep1)
35 %_tempFileName(d_rep2)
37 PROC MEANS NOPRINT NWAY missing DATA=&i_repdata(KEEP=cas_auton pgm_id scn_id cas_id);
38 class cas_auton pgm_id scn_id cas_id;
39 OUTPUT OUT=&d_rep1. (rename=(_FREQ_=scn_tst));
42 PROC MEANS NOPRINT NWAY missing DATA=&d_rep1.(KEEP=cas_auton pgm_id scn_id scn_tst);
43 class cas_auton pgm_id scn_id;
44 OUTPUT OUT=&d_rep2. (rename=(_FREQ_=scn_cas)) sum(scn_tst)=scn_tst;
47 PROC SORT DATA=&i_repdata. out=work._auton_report;
48 BY cas_auton pgm_id scn_id;
51 DATA work._auton_report;
52 SET work._auton_report;
53 BY cas_auton pgm_id scn_id;
57 DATA work._auton_report;
58 MERGE work._auton_report &d_rep2.;
59 BY cas_auton pgm_id scn_id;
63 %IF &g_crossref. EQ 1 %THEN %DO;
65 create view prepareDependency as
66 select distinct cas_pgm as name
70 DATA macrolistDependency;
71 SET prepareDependency;
73 name = substr(name, 1, length(name)-4);
75 pos = find(name,'/',-999);
77 len = length(trim(name));
78 name = substr(name,pos+1,len-pos);
83 %_dependency(i_dependencies = &d_listcalling.
84 ,i_macroList = macrolistDependency
87 %_dependency_agg(i_path = &g_target/tst/crossreference
88 ,o_file = &l_output/js/data.refs.js
93 PROC DATASETS NOLIST NOWARN LIB=%scan(&d_listcalling,1,.);
94 DELETE %SCAN(&d_macrolist,2,.);
95 DELETE %SCAN(&d_listcalling,2,.);
98 %IF &g_testcoverage. EQ 1 %THEN %DO;
103 %LET l_rc =%_delFile("&g_log/000.tcg");
105 %LET l_logpath=%_escapeBlanks(&g_log.);
107 FILENAME allfiles "&l_logpath.
121 SELECT DISTINCT cas_pgm
122 INTO :l_unitUnderTestList SEPARATED BY '*'
123 FROM work._auton_report;
126 DATA work._auton_report (COMPRESS=YES);
128 SET work._auton_report;
132 %LET l_listCount=%sysfunc(countw(&l_unitUnderTestList.,'*'));
133 %do i = 1 %to &l_listCount;
134 %LET l_currentUnit=%lowcase(%scan(&l_unitUnderTestList,&i,*));
135 %IF "%sysfunc(compress(&l_currentUnit.))" EQ "" %THEN %DO;
140 %let l_currentUnitLocation=;
141 %let l_currentUnitFileName=;
142 %IF (%SYSFUNC(FILEEXIST(&l_currentUnit.))) %THEN %DO;
143 %_getAbsPathComponents(
144 i_absPath = &l_currentUnit
145 , o_fileName = l_currentUnitFileName
146 , o_pathWithoutName = l_currentUnitLocation
150 %IF (%SYSFUNC(FILEEXIST(&g_root./&l_currentUnit.))) %THEN %DO;
151 %_getAbsPathComponents(
152 i_absPath = &g_root./&l_currentUnit.
153 , o_fileName = l_currentUnitFileName
154 , o_pathWithoutName = l_currentUnitLocation
158 %IF (%SYSFUNC(FILEEXIST(&g_sasunit./&l_currentUnit.))) %THEN %DO;
159 %_getAbsPathComponents(
160 i_absPath = &g_sasunit./&l_currentUnit.
161 , o_fileName = l_currentUnitFileName
162 , o_pathWithoutName = l_currentUnitLocation
165 %ELSE %IF (%SYSFUNC(FILEEXIST(&g_sasunit_os./&l_currentUnit.))) %THEN %DO;
166 %_getAbsPathComponents(
167 i_absPath = &g_sasunit_os./&l_currentUnit.
168 , o_fileName = l_currentUnitFileName
169 , o_pathWithoutName = l_currentUnitLocation
174 %DO %UNTIL ("&l_currentUnitLocation." NE "" OR &j. EQ 10);
175 %IF (%SYSFUNC(FILEEXIST(&&g_sasautos&j/&l_currentUnit.))) %THEN %DO;
176 %_getAbsPathComponents(
177 i_absPath = &&g_sasautos&j/&l_currentUnit.
178 , o_fileName = l_currentUnitFileName
179 , o_pathWithoutName = l_currentUnitLocation
182 %LET j = %EVAL(&j + 1);
189 %IF ("&l_currentUnitFileName." NE "" AND "&l_currentUnitLocation." NE ""
190 AND %SYSFUNC(FILEEXIST(&l_currentUnitLocation./&l_currentUnitFileName.))
191 AND %SYSFUNC(FILEEXIST(&g_log./000.tcg)) ) %THEN %DO;
192 %_reporttcghtml(i_macroName = &l_currentUnitFileName.
193 ,i_macroLocation = &l_currentUnitLocation.
194 ,i_mCoverageName = 000.tcg
195 ,i_mCoverageLocation = &g_log
196 ,o_outputFile = tcg_%SCAN(&l_currentUnitFileName.,1,.)
197 ,o_outputPath = &g_target/rep
198 ,o_resVarName = l_tcg_res
205 UPDATE work._auton_report
206 SET tcg_pct=&l_tcg_res.
207 WHERE upcase(cas_pgm) EQ "%upcase(&l_currentUnit.)";
214 SELECT DISTINCT cas_auton
215 INTO :l_pgmLibraries SEPARATED BY '§'
216 FROM work._auton_report;
223 %let l_title=%str(&g_nls_reportAuton_001 | &g_project - SASUnit &g_nls_reportAuton_002);
224 title j=c "&l_title.";
226 %if (&o_html.) %then %do;
227 ods html4 file="&o_path./&o_file..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.
239 %LET l_listCount=%sysfunc(countw(&l_pgmLibraries.,'§'));
240 %do i = 1 %to &l_listCount.;
241 %LET l_pgmLib=%lowcase(%scan(&l_pgmLibraries,&i,§));
243 %IF (l_pgmLib ne .) %THEN %DO;
244 %LET l_cAuton=%sysfunc (putn(&l_pgmLib.,z3.))_;
246 data work._current_auton;
247 length pgmColumn scenarioColumn caseColumn assertColumn
248 %IF &g_testcoverage. EQ 1 %THEN %DO;
251 %IF &g_crossref. EQ 1 %THEN %DO;
255 linkTitle0 linkTitle1 LinkTitle2 LinkTitle3 LinkTitle4 LinkTitle5
256 linkColumn0 linkColumn1 LinkColumn2 LinkColumn3 LinkColumn4 LinkColumn5 $1000
257 _autonColumn autonColumn cas_abs_path scn_abs_path $400;
258 set work._auton_report (where=(cas_auton=&l_pgmLib.));
259 ARRAY sa(0:9) tsu_sasautos tsu_sasautos1-tsu_sasautos9;
261 pgmColumn="&g_nls_reportAuton_005."
262 scenarioColumn="&g_nls_reportAuton_006."
263 caseColumn="&g_nls_reportAuton_007."
264 assertColumn="&g_nls_reportAuton_014."
265 %IF &g_testcoverage. EQ 1 %THEN %DO;
266 coverageColumn="&g_nls_reportAuton_016." [%]
268 %IF &g_crossref. EQ 1 %THEN %DO;
269 crossrefColumn="&g_nls_reportAuton_022."
271 resultColumn="&g_nls_reportAuton_008.";
273 if (cas_pgm="^_") then cas_pgm="";
274 IF cas_auton = . THEN DO;
275 cas_abs_path = resolve ('%_abspath(&g_root,' !! trim(cas_pgm) !! ')');
277 ELSE IF cas_auton = 0 THEN DO;
278 cas_abs_path = resolve ('%_abspath(&g_sasunit,' !! trim(cas_pgm) !! ')');
280 ELSE IF cas_auton = 1 THEN DO;
281 cas_abs_path = resolve ('%_abspath(&g_sasunit_os,' !! trim(cas_pgm) !! ')');
284 cas_abs_path = resolve ('%_abspath(&g_sasautos' !! put (cas_auton-2,1.) !! ',' !! trim(cas_pgm) !! ')');
286 scn_abs_path = resolve ('%_abspath(&g_root,' !! trim(scn_path) !! ')');
288 %_render_dataColumn(i_sourceColumn=scn_cas
289 ,o_targetColumn=caseColumn
291 %_render_dataColumn(i_sourceColumn=scn_tst
292 ,o_targetColumn=assertColumn
294 %_render_iconColumn(i_sourceColumn=scn_res
296 ,o_targetColumn=resultColumn
298 if (cas_auton = .) then do;
299 _autonColumn = "&g_nls_reportAuton_015.";
302 if (cas_auton = 0) then do;
303 _autonColumn = tsu_sasunit;
304 linkTitle0 = symget("g_sasunit");
306 else if (cas_auton = 1) then do;
307 _autonColumn = tsu_sasunit_os;
308 linkTitle0 = symget("g_sasunit_os");
311 _autonColumn = sa(cas_auton-2);
312 linkTitle0 = symget("g_sasautos" !! put(cas_auton-2, z1.));
315 linkTitle0 = "&g_nls_reportAuton_009. " !! linkTitle0;
317 %_render_dataColumn(i_sourceColumn=_autonColumn
318 ,i_linkColumn=LinkColumn0
319 ,i_linkTitle=LinkTitle0
320 ,o_targetColumn=autonColumn
322 autonColumn="&g_nls_reportAuton_003.: " !! trim(autonColumn);
324 *** Any destination that renders links shares this if ***;
325 %if (&o_html.) %then %do;
326 LinkTitle1 = "&g_nls_reportAuton_009." !! byte(13) !! cas_abs_path;
327 LinkTitle2 = "&g_nls_reportAuton_010." !! byte(13) !! scn_abs_path;
328 LinkTitle3 = "&g_nls_reportAuton_017. " !! cas_pgm;
329 LinkTitle4 = trim(cas_pgm) !! " &g_nls_reportAuton_025.";
330 LinkTitle5 = trim(cas_pgm) !! " &g_nls_reportAuton_026.";
332 *** HTML-links are destination specific ***;
333 %if (&o_html.) %then %do;
335 LinkColumn2 = CATT("cas_overview.html
#SCN", PUT(scn_id,z3.), "_");
336 IF compress(cas_pgm) ne '' THEN DO;
337 IF index(cas_pgm,'/') GT 0 THEN DO;
338 LinkColumn3 = 'tcg_'||trim(LEFT(SCAN(SUBSTR(cas_pgm, findw(cas_pgm, SCAN(cas_pgm, countw(cas_pgm,'/'),'/'))),1,".") !! ".html"));
341 LinkColumn3 = 'tcg_'||TRIM(LEFT(SCAN(cas_pgm,1,".") !! ".html"));
344 LinkColumn4 = "&g_nls_reportAuton_023.";
345 LinkColumn5 = "&g_nls_reportAuton_024.";
348 %_render_dataColumn(i_sourceColumn=cas_pgm
349 ,i_linkColumn=LinkColumn1
350 ,i_linkTitle=LinkTitle1
351 ,o_targetColumn=pgmColumn
353 %_render_dataColumn(i_sourceColumn=scn_id
355 ,i_linkColumn=LinkColumn2
356 ,i_linkTitle=LinkTitle2
357 ,o_targetColumn=scenarioColumn
359 %IF &g_testcoverage. EQ 1 %THEN %DO;
360 %_render_dataColumn(i_sourceColumn=tcg_pct
362 ,i_linkColumn=LinkColumn3
363 ,i_linkTitle=LinkTitle3
364 ,o_targetColumn=coverageColumn
367 %IF &g_crossref. EQ 1 %THEN %DO;
368 %_render_crossrefColumn (i_sourceColumn = %sysfunc(trim(cas_pgm))
369 ,o_targetColumn = crossrefColumn
370 ,i_linkColumn_caller = LinkColumn4
371 ,i_linkTitle_caller = LinkTitle4
372 ,i_linkColumn_called = LinkColumn5
373 ,i_linkTitle_called = LinkTitle5
379 %IF (&i. = &l_listCount.) %THEN %DO;
380 %_reportFooter(o_html=&o_html.);
383 %IF (&o_html.) %THEN %DO;
384 ods html4 anchor="AUTON&l_cAuton.";
387 PROC REPORT DATA=work._current_auton nowd missing spanrows
388 style(lines)=blindData
391 columns pgm_id pgmColumn scenarioColumn caseColumn assertColumn
392 %IF &g_testcoverage. EQ 1 %THEN %DO;
395 %IF &g_crossref. EQ 1 %THEN %DO;
398 resultColumn autonColumn;
400 define autonColumn / noprint;
401 define pgm_id / order noprint;
402 define pgmColumn / order;
403 define scenarioColumn / order style(column)=[just=right];
404 define caseColumn / order style(column)=[just=right];
405 define assertColumn / order style(column)=[just=right];
406 %IF &g_testcoverage. EQ 1 %THEN %DO;
407 define coverageColumn / order style(column)=[just=right];
409 %IF &g_crossref. EQ 1 %THEN %DO;
410 define crossrefColumn / order style(column)=[just=right];
412 define resultColumn / order style(COLUMN)=[background=white];
414 compute before _page_;
415 line @1 autonColumn $;
419 *** Supress title between testcases ***;
420 %IF (&i. = 1) %THEN %DO;
424 *** Render separation line between program libraries ***;
425 %IF (&o_html. AND &i. ne &l_listCount.) %THEN %DO;
426 ods html4 text="^{RAW <hr size=
""1
"">}
";
429 PROC DELETE data=work._current_auton;
435 %IF (&o_html.) %THEN %DO;
444 PROC DELETE DATA=work._auton_report;
446 %MEND _reportAutonHTML;