SASUnit Examples  Version 1.2.1
_sasunit_reportcashtml.sas
Go to the documentation of this file.
1 
20 /* change history
21  06.02.2012 OT minor bugfix
22  12.08.2008 AM Mehrsprachigkeit
23  29.12.2007 AM verbesserte Beschriftungen
24 */
25 
26 %MACRO _sasunit_reportCasHTML (
27  i_repdata =
28  ,o_html =
29 );
30 
31 %LOCAL
32  l_nls_reportcas_errors
33 ;
34 %LET l_nls_reportcas_errors = %STR(error(s));
35 
36 DATA _null_;
37  SET &i_repdata END=eof;
38  BY scn_id cas_id;
39 
40  FILE "&o_html";
41 
42  IF _n_=1 THEN DO;
43 
44  %_sasunit_reportPageTopHTML(
45  i_title = %str(&g_nls_reportCas_001 | &g_project - &g_nls_reportCas_002)
46  ,i_current = 3
47  )
48  END;
49 
50  LENGTH
51  abs_path $ 256
52  hlp $ 20
53  errcountmsg $ 50
54  ;
55 
56  IF first.scn_id THEN DO;
57 
58  IF _n_>1 THEN DO;
59  PUT '<hr size="1">';
60  END;
61 
62  PUT '<table id="scn' scn_id z3. '"><tr>';
63  PUT " <td>&g_nls_reportCas_011</td>";
64  PUT ' <td>' scn_id z3. '</td>';
65  PUT '</tr><tr>';
66  PUT " <td>&g_nls_reportCas_003</td>";
67  PUT ' <td>' scn_desc +(-1) '</td>';
68  PUT '</tr><tr>';
69  PUT " <td>&g_nls_reportCas_004</td>";
70 
71  abs_path = resolve ('%_sasunit_abspath(&g_root,' !! trim(scn_path) !! ')');
72 
73  PUT ' <td><a class="lightlink" title="' "&g_nls_reportCas_005 " '&#x0D;' abs_path +(-1) '" href="' abs_path +(-1) '">' scn_path +(-1) '</a></td>';
74  PUT '</tr><tr>';
75  PUT " <td>&g_nls_reportCas_022</td>";
76 
77  IF scn_errorcount GT 0 THEN DO;
78  errcountmsg = '(' !! put(scn_errorcount, 3.) !! ' ' !! "&l_nls_reportcas_errors." !! ')';
79  END;
80  ELSE DO;
81  errcountmsg = '';
82  END;
83 
84  PUT ' <td><a class="lightlink" title="' "&g_nls_reportCas_006" '" href="' scn_id z3. '_log.html">' scn_start &g_nls_reportCas_007 '</a>&nbsp;<span class="logerrcountmsg">' errcountmsg '</span> </td>';
85 
86  duration = scn_end - scn_start;
87 
88  PUT '</tr><tr>';
89  PUT " <td>&g_nls_reportCas_008</td>";
90  PUT ' <td>' duration &g_nls_reportCas_009 's</td>';
91  PUT '</tr><tr>';
92  PUT " <td>&g_nls_reportCas_010</td>";
93  PUT '</tr></table>';
94 
95  PUT '<table>';
96  PUT '<tr>';
97  PUT ' <td class="tabheader">' "&g_nls_reportCas_011" '</td>';
98  PUT ' <td class="tabheader">' "&g_nls_reportCas_012" '</td>';
99  PUT ' <td class="tabheader">' "&g_nls_reportCas_013" '</td>';
100  PUT ' <td class="tabheader">' "&g_nls_reportCas_014" '</td>';
101  PUT ' <td class="tabheader">' "&g_nls_reportCas_015" '</td>';
102  PUT ' <td class="tabheader">' "&g_nls_reportCas_016" '</td>';
103  PUT '</tr>';
104  END;
105 
106  IF first.cas_id THEN DO;
107  PUT '<tr>';
108  PUT ' <td class="idcolumn"><a class="lightlink" title="' "&g_nls_reportCas_017 " cas_id z3. '" href="cas_' scn_id z3. '_' cas_id z3. '.html">' cas_id z3. '</a></td>';
109  PUT ' <td class="datacolumn"><a class="lightlink" title="' "&g_nls_reportCas_017 " cas_id z3. '" href="cas_' scn_id z3. '_' cas_id z3. '.html">' cas_desc +(-1) '</a></td>';
110  IF cas_auton = '0' THEN hlp = '&g_sasautos';
111  ELSE hlp = '&g_sasautos' !! put (cas_auton,1.);
112  abs_path = resolve ('%_sasunit_abspath(' !! trim(hlp) !! ',' !! trim(cas_pgm) !! ')');
113  PUT ' <td class="datacolumn"><a class="lightlink" title="' "&g_nls_reportCas_018 " '&#x0D;' abs_path +(-1) '" href="' abs_path +(-1) '">' cas_pgm +(-1) '</a></td>';
114  PUT ' <td class="datacolumn"><a class="lightlink" title="' "&g_nls_reportCas_006" '" href="' scn_id z3. '_' cas_id z3. '_log.html">' cas_start &g_nls_reportCas_007 '</a></td>';
115  duration = cas_end - cas_start;
116  PUT ' <td class="datacolumn">' duration &g_nls_reportCas_009 's</td>';
117  PUT ' <td class="iconcolumn"><img src=' @;
118  SELECT (cas_res);
119  WHEN (0) PUT '"ok.png" alt="OK"' @;
120  WHEN (1) PUT '"error.png" alt="' "&g_nls_reportCas_019" '"' @;
121  WHEN (2) PUT '"manual.png" alt="' "&g_nls_reportCas_020" '"' @;
122  OTHERWISE PUT '"?????" alt="' "&g_nls_reportCas_021" '"' @;
123  END;
124  PUT '></img></td>';
125  PUT '</tr>';
126  END;
127 
128  IF last.scn_id THEN DO;
129  PUT '</table>';
130  END;
131 
132  IF eof THEN DO;
133  %_sasunit_reportFooterHTML()
134  END;
135 
136 RUN;
137 
138 %MEND _sasunit_reportCasHTML;