29 %MACRO _sasunit_reportAutonHTML (
36 %LOCAL d_rep1 d_rep2 l_tcg_res;
37 %_sasunit_tempFileName(d_rep1)
38 %_sasunit_tempFileName(d_rep2)
41 PROC MEANS NOPRINT NWAY DATA=&i_repdata(KEEP=cas_auton pgm_id scn_id cas_res);
42 BY cas_auton pgm_id scn_id;
44 OUTPUT OUT=&d_rep1 (drop=_type_);
47 PROC TRANSPOSE DATA=&d_rep1 OUT=&d_rep1 (DROP=_name_) PREFIX=res;
48 BY cas_auton pgm_id scn_id;
53 PROC MEANS NOPRINT NWAY DATA=&d_rep1(KEEP=cas_auton pgm_id);
55 OUTPUT OUT=&d_rep2 (DROP=_type_ RENAME=(_freq_=scn_count));
58 DATA &d_rep1 (COMPRESS=YES);
59 MERGE &i_repdata (KEEP=cas_auton pgm_id scn_id cas_pgm tsu_sasautos tsu_sasautos1-tsu_sasautos9) &d_rep1;
60 BY cas_auton pgm_id scn_id;
61 IF res0=. THEN res0=0;
62 IF res1=. THEN res1=0;
63 IF res2=. THEN res2=0;
66 DATA &d_rep1 (COMPRESS=YES);
67 MERGE &d_rep1 &d_rep2;
71 PROC MEANS NOPRINT NWAY missing DATA=&i_repdata(KEEP=cas_auton pgm_id scn_id cas_id);
72 class cas_auton pgm_id scn_id cas_id;
76 PROC MEANS NOPRINT NWAY missing DATA=&d_rep2(KEEP=cas_auton pgm_id scn_id cas_id);
77 class cas_auton pgm_id scn_id;
78 OUTPUT OUT=&d_rep2 (drop=_type_ cas_id rename=(_freq_=scn_cas)) N=;
81 DATA &d_rep1 (COMPRESS=YES);
82 MERGE &d_rep1 &d_rep2;
83 BY cas_auton pgm_id scn_id;
86 %IF &g_testcoverage. EQ 1 %THEN %DO;
91 %let l_rc =%_sasunit_delFile("&g_log/000.tcg");
93 FILENAME allfiles "&g_log
107 SELECT DISTINCT cas_pgm
108 INTO:l_unitUnderTestList SEPARATED BY '*'
112 DATA &d_rep1 (COMPRESS=YES);
118 %LET l_listCount=%sysfunc(countw(&l_unitUnderTestList.,'*'));
119 %do i = 1 %to &l_listCount;
120 %LET l_currentUnit=%lowcase(%scan(&l_unitUnderTestList,&i,*));
121 %IF "%sysfunc(compress(&l_currentUnit.))" EQ "" %THEN %DO;
126 %let l_currentUnitLocation=;
127 %let l_currentUnitFileName=;
128 %IF (%SYSFUNC(FILEEXIST(&l_currentUnit.))) %THEN %DO;
129 %_sasunit_getAbsPathComponents(
130 i_absPath = &l_currentUnit
131 , o_fileName = l_currentUnitFileName
132 , o_pathWithoutName = l_currentUnitLocation
136 %IF (%SYSFUNC(FILEEXIST(&g_root./&l_currentUnit.))) %THEN %DO;
137 %_sasunit_getAbsPathComponents(
138 i_absPath = &g_root./&l_currentUnit.
139 , o_fileName = l_currentUnitFileName
140 , o_pathWithoutName = l_currentUnitLocation
144 %IF (%SYSFUNC(FILEEXIST(&g_sasautos./&l_currentUnit.))) %THEN %DO;
145 %_sasunit_getAbsPathComponents(
146 i_absPath = &g_sasautos./&l_currentUnit.
147 , o_fileName = l_currentUnitFileName
148 , o_pathWithoutName = l_currentUnitLocation
153 %DO %UNTIL ("&l_currentUnitLocation." NE "" OR &j. EQ 10);
154 %IF (%SYSFUNC(FILEEXIST(&&g_sasautos&j/&l_currentUnit.))) %THEN %DO;
155 %_sasunit_getAbsPathComponents(
156 i_absPath = &&g_sasautos&j/&l_currentUnit.
157 , o_fileName = l_currentUnitFileName
158 , o_pathWithoutName = l_currentUnitLocation
161 %LET j = %EVAL(&j + 1);
168 %IF ("&l_currentUnitFileName." NE "" AND "&l_currentUnitLocation." NE ""
169 AND %SYSFUNC(FILEEXIST(&l_currentUnitLocation./&l_currentUnitFileName.))
170 AND %SYSFUNC(FILEEXIST(&g_log./000.tcg)) ) %THEN %DO;
171 %_sasunit_reporttcghtml(
172 i_macroName = &l_currentUnitFileName.
173 ,i_macroLocation = &l_currentUnitLocation.
174 ,i_mCoverageName = 000.tcg
175 ,i_mCoverageLocation = &g_log
176 ,o_outputFile = tcg_%SCAN(&l_currentUnitFileName.,1,.).html
177 ,o_outputPath = &g_target/rep
178 ,o_resVarName = l_tcg_res
185 SET tcg_pct=&l_tcg_res.
186 WHERE upcase(cas_pgm) EQ "%upcase(&l_currentUnit.)";
194 BY cas_auton pgm_id scn_id;
199 %_sasunit_reportPageTopHTML(
200 i_title = %str(&g_nls_reportAuton_001 | &g_project - SASUnit &g_nls_reportAuton_002)
205 LENGTH hlp1 hlp2 hlp3 hlpp $256;
208 IF first.cas_auton THEN DO;
212 IF cas_auton NE . THEN hlp3 = 'auton' !! put (cas_auton, z3.);
214 PUT '<table
id="' hlp3 +(-1) '"><tr>';
215 PUT " <td>&g_nls_reportAuton_003</td>";
216 IF cas_auton>=0 THEN DO;
217 ARRAY sa(0:9) tsu_sasautos tsu_sasautos1-tsu_sasautos9;
218 hlp1 = sa(cas_auton);
219 IF cas_auton=0 THEN hlp2 = symget('g_sasautos');
220 ELSE hlp2 = symget ('g_sasautos' !! compress(put(cas_auton,8.)));
221 PUT ' <td><a class="lightlink" title="' "&g_nls_reportAuton_004 " '&
#x0D;' hlp2 +(-1) '" href="file://' hlp2 +(-1) '">' hlp1 +(-1) '</a></td>';
224 PUT
" <td>&g_nls_reportAuton_015</td>";
230 PUT
' <td class="tabheader">' "&g_nls_reportAuton_005" '</td>';
231 PUT
' <td class="tabheader">' "&g_nls_reportAuton_006" '</td>';
232 PUT
' <td class="tabheader">' "&g_nls_reportAuton_007" '</td>';
233 PUT
' <td class="tabheader">' "&g_nls_reportAuton_014" '</td>';
234 %IF &g_testcoverage. EQ 1 %THEN %DO;
235 PUT
' <td class="tabheader">' "&g_nls_reportAuton_016" ' [%]' '</td>';
237 PUT
' <td class="tabheader">' "&g_nls_reportAuton_008" '</td>';
241 IF first.scn_id THEN DO;
245 IF first.pgm_id THEN DO;
246 IF cas_auton = . THEN DO;
247 hlp2 = resolve (
'%_sasunit_abspath(&g_root,' !! trim(cas_pgm) !!
')');
250 IF cas_auton = 0 THEN hlp1 =
'&g_sasautos';
251 ELSE hlp1 =
'&g_sasautos' !! compress (put (cas_auton,8.));
252 hlp2 = resolve (
'%_sasunit_abspath(' !! trim(hlp1) !!
',' !! trim(cas_pgm) !!
')');
254 PUT
' <td id="' hlp3 +(-1)
'_' pgm_id z3.
'" rowspan="' scn_count +(-1)
'" class="datacolumn"><a class="lightlink" title="' "&g_nls_reportAuton_009 " '
' hlp2 +(-1)
'" href="' hlp2 +(-1)
'">' cas_pgm +(-1)
'</a></td>';
257 IF first.scn_id THEN DO;
258 PUT
' <td class="datacolumn"><a class="lightlink" title="' "&g_nls_reportAuton_010 " scn_id z3.
'" href="cas_overview.html#scn' scn_id z3.
'">' scn_id z3.
'</a></td>';
259 hlp1 = left (put (scn_cas, 8.));
260 PUT
' <td class="datacolumn">' hlp1 +(-1)
'</td>';
261 hlp1 = left (put (sum (res0, res1, res2), 8.));
262 PUT
' <td class="datacolumn">' hlp1 +(-1)
'</td>';
263 %IF &g_testcoverage. EQ 1 %THEN %DO;
264 if compress(cas_pgm) ne '' then do;
265 if index(cas_pgm,'/') GT 0 then do;
266 hlpp = 'tcg_'||compress(trim(left(scan(substr(cas_pgm, findw(cas_pgm, scan(cas_pgm, countw(cas_pgm,'/'),'/'))),1,.) !! ".html")));
269 hlpp = 'tcg_'||compress(trim(left(scan(cas_pgm,1,.) !! ".html")));
272 if tcg_pct eq . then do;
273 PUT ' <td class="datacolumn"> </td>';
276 PUT ' <td class="datacolumn"><a class="lightlink" title="' "&g_nls_reportAuton_017. " cas_pgm +(-1) '" href="' hlpp '">' tcg_pct +(-1) '</a></td>';
279 PUT ' <td class="iconcolumn"><img src=' @;
280 IF res1>0 THEN PUT '"error.png" alt="' "&g_nls_reportAuton_011" '"' @;
281 ELSE IF res2>0 THEN PUT '"manual.png" alt="' "&g_nls_reportAuton_012" '"' @;
282 ELSE IF res0>0 THEN PUT '"ok.png" alt="OK"' @;
283 ELSE PUT '"?????" alt="' "&g_nls_reportAuton_013" '"' @;
288 IF last.cas_auton THEN DO;
293 %_sasunit_reportFooterHTML()
298 PROC DATASETS NOWARN NOLIST LIB=work;
299 DELETE %scan(&d_rep1,2,.) %scan(&d_rep2,2,.);
302 %MEND _sasunit_reportAutonHTML;