62%macro mp_assertcolvals(indscol,
65 desc=mp_assertcolvals - no desc provided,
66 outds=work.test_results
69 %mp_abort(iftrue= (&syscc ne 0)
71 ,msg=%str(syscc=&syscc - on macro entry)
74 %local lib ds col clib cds ccol nobs;
75 %let lib=%scan(&indscol,1,%str(.));
76 %let ds=%scan(&indscol,2,%str(.));
77 %let col=%scan(&indscol,3,%str(.));
78 %mp_abort(iftrue= (%mf_existds(&lib..&ds)=0)
80 ,msg=%str(&lib..&ds not found!)
83 %mp_abort(iftrue= (&checkvals=0)
85 ,msg=%str(Set CHECKVALS to a library.dataset.column containing check vals)
87 %let clib=%scan(&checkvals,1,%str(.));
88 %let cds=%scan(&checkvals,2,%str(.));
89 %let ccol=%scan(&checkvals,3,%str(.));
90 %mp_abort(iftrue= (%mf_existds(&clib..&cds)=0)
92 ,msg=%str(&clib..&cds not found!)
94 %let nobs=%mf_nobs(&clib..&cds);
95 %mp_abort(iftrue= (&nobs=0)
97 ,msg=%str(&clib..&cds is empty!)
100 %let test=%upcase(&test);
102 %
if &test ne ALLVALS and &test ne ANYVAL and &test ne NOVAL %then %
do;
105 msg=%str(Invalid test - &test)
113 select count(*) into: result trimmed
116 select &ccol from &clib..&cds
118 select count(*) into: orig trimmed from &lib..&ds;
121 %local notfound tmp1 tmp2;
122 %let tmp1=%mf_getuniquename();
123 %let tmp2=%mf_getuniquename();
131 select &ccol from &clib..&cds
138 select distinct &col into: notfound separated by
' ' from &tmp2;
141 %mp_abort(iftrue= (&syscc ne 0)
143 ,msg=%str(syscc=&syscc after macro query)
147 %let rsds=work.%mf_getuniquename(prefix=mp_assertcolvals);
151 test_description=symget('desc');
153 test_comments=
"&sysmacroname: &lib..&ds..&col has &result/&orig values "
154 !!
"not in &clib..&cds..&ccol.. First 10 vals:"!!symget('notfound');
155 %if &test=ANYVAL %then %do;
156 if &result < &orig then test_result='PASS';
158 %else %if &test=ALLVALS %then %do;
159 if &result=0 then test_result='PASS';
161 %else %if &test=NOVAL %then %do;
162 if &result=&orig then test_result='PASS';
165 test_comments=
"&sysmacroname: Unsatisfied test condition - &test";
169 proc append base=&outds data=&rsds;
174%mend mp_assertcolvals;