SASUnit Examples  Version 1.3.0
_render_assertforeignkeyrep.sas
Go to the documentation of this file.
1 
26 %macro _render_assertForeignKeyRep (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 dsid cnt rc;
36 
37  TITLE;FOOTNOTE;
38 
39  %_getTestSubfolder (i_assertType=assertForeignKey
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 _afkLib "&l_path";
48 
49  %IF (&o_html.) %then %do;
50  ODS HTML4 FILE="&o_path/_&i_scnid._&i_casid._&i_tstid._foreignkey_rep.html" stylesheet=(url="SAS_SASUnit.css");
51  %END;
52 
53  TITLE "&g_nls_reportForeignKey_011";
54  TITLE2 "&g_nls_reportForeignKey_013.";
55  %IF %sysfunc(exist(_afkLib.keyNotFndLookUp)) %THEN %DO;
56  %LET dsid=%sysfunc(open(_afkLib.keyNotFndLookUp));
57  %LET cnt =%sysfunc(attrn(&dsid,nlobs));
58  %LET rc =%sysfunc(close(&dsid));
59  %IF &cnt ne 0 %THEN %DO;
60  PROC PRINT DATA=_afkLib.keyNotFndLookUp;
61  RUN;
62  %END;
63  %ELSE %DO;
64  DATA _null_;
65  FILE PRINT;
66  PUT "&g_nls_reportForeignKey_012.";
67  RUN;
68  %END;
69  %END;
70  %ELSE %DO;
71  DATA _null_;
72  FILE PRINT;
73  PUT "&g_nls_reportForeignKey_015.";
74  RUN;
75  %END;
76  TITLE;
77  TITLE2 "&g_nls_reportForeignKey_014.";
78  %_reportFooter(o_html=&o_html.);
79  %IF %sysfunc(exist(_afkLib.keyNotFndMstr)) %THEN %DO;
80  %LET dsid=%sysfunc(open(_afkLib.keyNotFndMstr));
81  %LET cnt =%sysfunc(attrn(&dsid,nlobs));
82  %LET rc =%sysfunc(close(&dsid));
83 
84  %IF &cnt ne 0 %THEN %DO;
85  PROC PRINT DATA=_afkLib.keyNotFndMstr;
86  RUN;
87  %END;
88  %ELSE %DO;
89  DATA _null_;
90  FILE PRINT;
91  PUT "&g_nls_reportForeignKey_015.";
92  RUN;
93  %END;
94  %END;
95  %ELSE %DO;
96  DATA _null_;
97  FILE PRINT;
98  PUT "&g_nls_reportForeignKey_012.";
99  RUN;
100  %END;
101 
102  %IF (&o_html.) %then %do;
103  %_closeHtmlPage;
104  %END;
105 
106  TITLE; FOOTNOTE;
107 %MEND _render_assertForeignKeyRep;