SASUnit Examples  Version 1.3.0
_render_assertlibraryrep.sas
Go to the documentation of this file.
1 
26 %macro _render_assertLibraryRep (i_assertype=
27  ,i_repdata =
28  ,i_scnid =
29  ,i_casid =
30  ,i_tstid =
31  ,o_html = 0
32  ,o_path =
33  );
34 
35  %local l_path;
36 
37  title;footnote;
38 
39  %_getTestSubfolder (i_assertType=assertLibrary
40  ,i_root =&g_target./tst
41  ,i_scnid =&i_scnid.
42  ,i_casid =&i_casid.
43  ,i_tstid =&i_tstid.
44  ,r_path =l_path
45  );
46 
47  libname _test "&l_path";
48 
49  %if (&o_html.) %then %do;
50  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._library_exp.html" style=styles.SASUnit stylesheet=(url="SAS_SASUnit.css");
51  %end;
52 
53  %_reportFooter(o_html=&o_html.);
54 
55  %if (%sysfunc (libref(_test))=0) %then %do;
56  TITLE "&g_nls_reportLibrary_006";
57  PROC DOCUMENT NAME=_test._library_exp;
58  REPLAY / ACTIVETITLE ACTIVEFOOTN;
59  RUN;
60  %end;
61  %else %do;
62  DATA _null_;
63  PUT ' ';
64  RUN;
65  %end;
66 
67  %if (&o_html.) %then %do;
68  %_closeHtmlPage;
69  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._library_act.html" style=styles.SASUnit stylesheet=(url="SAS_SASUnit.css");
70  %end;
71  %if (%sysfunc (libref(_test))=0) %then %do;
72  PROC DOCUMENT NAME=_test._library_act;
73  REPLAY / ACTIVETITLE ACTIVEFOOTN;
74  QUIT;
75  %end;
76  %else %do;
77  DATA _null_;
78  PUT ' ';
79  RUN;
80  %end;
81 
82  %if (&o_html.) %then %do;
83  %_closeHtmlPage;
84  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._library_rep.html" style=styles.SASUnit stylesheet=(url="SAS_SASUnit.css");
85  %end;
86 
87  %if (%sysfunc (exist (_test._library_rep, DATA))) %then %do;
88  %local l_LibraryCheck l_CompareCheck l_id l_ExcludeList;
89 
90  %*** format results for report ***;
91  data WORK._library_rep;
92  Length resultColumn $400;
93  set _test._library_rep;
94  %_render_iconColumn (i_sourceColumn=CompareFailed
95  ,o_html=&o_html.
96  ,o_targetColumn=resultColumn
97  );
98  run;
99 
100  proc sql noprint;
101  select i_LibraryCheck, i_CompareCheck, i_id, i_ExcludeList
102  into :l_LibraryCheck, :l_CompareCheck, :l_id, :l_ExcludeList
103  from _test._library_rep (obs=1);
104  quit;
105 
106  options missing=' ';
107  TITLE " ";
108  Title2 h=3 "LibraryCheck=%trim(&l_LibraryCheck.) - CompareCheck=%trim(&l_CompareCheck.)";
109  %if (&l_id. ne _NONE_) %then %do;
110  Title3 h=3 "ID-Columns: %trim (&l_id.)";
111  %end;
112  %if (&l_ExcludeList. ne _NONE_) %then %do;
113  Title4 h=3 "&g_nls_reportLibrary_002: %trim (&l_ExcludeList.)";
114  %end;
115  proc report data=WORK._library_rep nowd missing
116  style (column)={vjust=center};
117  columns memname
118  ("&g_nls_reportLibrary_003" CmpLibname CmpObs CmpNVar)
119  ("&g_nls_reportLibrary_004" BaseLibname BaseObs BaseNVar)
120  resultColumn
121  ;
122  define memname / id style={font_weight=bold foreground=black};
123  define resultColumn / "&g_nls_reportLibrary_005" style(column)={background=white};
124  run;
125  options missing=.;
126  %end;
127  %else %do;
128  DATA _null_;
129  PUT ' ';
130  RUN;
131  %end;
132  %if (&o_html.) %then %do;
133  %_closeHtmlPage;
134  %end;
135 
136  LIBNAME _test;
137 
138  title;footnote;
139 %MEND _render_assertLibraryRep;