SASUnit Examples  Version 1.5.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"
51  style=styles.SASUnit
52  stylesheet=(url="css/SAS_SASUnit.css")
53  encoding="&g_rep_encoding.";
54  %end;
55 
56  %_reportFooter(o_html=&o_html.);
57 
58  %if (%sysfunc (libref(_test))=0) %then %do;
59  TITLE "&g_nls_reportLibrary_006";
60  PROC DOCUMENT NAME=_test._library_exp;
61  REPLAY / ACTIVETITLE ACTIVEFOOTN;
62  RUN;
63  %end;
64  %else %do;
65  DATA _null_;
66  PUT ' ';
67  RUN;
68  %end;
69 
70  %if (&o_html.) %then %do;
71  %_closeHtmlPage;
72  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._library_act.html"
73  style=styles.SASUnit
74  stylesheet=(url="css/SAS_SASUnit.css")
75  encoding="&g_rep_encoding.";
76  %end;
77  %if (%sysfunc (libref(_test))=0) %then %do;
78  PROC DOCUMENT NAME=_test._library_act;
79  REPLAY / ACTIVETITLE ACTIVEFOOTN;
80  QUIT;
81  %end;
82  %else %do;
83  DATA _null_;
84  PUT ' ';
85  RUN;
86  %end;
87 
88  %if (&o_html.) %then %do;
89  %_closeHtmlPage;
90  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._library_rep.html"
91  style=styles.SASUnit
92  stylesheet=(url="css/SAS_SASUnit.css")
93  encoding="&g_rep_encoding.";
94  %end;
95 
96  %if (%sysfunc (exist (_test._library_rep, DATA))) %then %do;
97  %local l_LibraryCheck l_CompareCheck l_id l_ExcludeList;
98 
99  %*** format results for report ***;
100  data WORK._library_rep;
101  Length resultColumn $400;
102  set _test._library_rep;
103  %_render_iconColumn (i_sourceColumn=CompareFailed
104  ,o_html=&o_html.
105  ,o_targetColumn=resultColumn
106  );
107  run;
108 
109  proc sql noprint;
110  select i_LibraryCheck, i_CompareCheck, i_id, i_ExcludeList
111  into :l_LibraryCheck, :l_CompareCheck, :l_id, :l_ExcludeList
112  from _test._library_rep (obs=1);
113  quit;
114 
115  options missing=' ';
116  TITLE " ";
117  Title2 h=3 "LibraryCheck=%trim(&l_LibraryCheck.) - CompareCheck=%trim(&l_CompareCheck.)";
118  %if (&l_id. ne _NONE_) %then %do;
119  Title3 h=3 "ID-Columns: %trim (&l_id.)";
120  %end;
121  %if (&l_ExcludeList. ne _NONE_) %then %do;
122  Title4 h=3 "&g_nls_reportLibrary_002: %trim (&l_ExcludeList.)";
123  %end;
124  proc report data=WORK._library_rep nowd missing
125  style (column)={vjust=center};
126  columns memname
127  ("&g_nls_reportLibrary_003" CmpLibname CmpObs CmpNVar)
128  ("&g_nls_reportLibrary_004" BaseLibname BaseObs BaseNVar)
129  resultColumn
130  ;
131  define memname / id style={font_weight=bold foreground=black};
132  define resultColumn / "&g_nls_reportLibrary_005" style(column)={background=white};
133  run;
134  options missing=.;
135  %end;
136  %else %do;
137  DATA _null_;
138  PUT ' ';
139  RUN;
140  %end;
141  %if (&o_html.) %then %do;
142  %_closeHtmlPage;
143  %end;
144 
145  LIBNAME _test;
146 
147  title;footnote;
148 %MEND _render_assertLibraryRep;