61%macro mp_assertcolvals(indscol,
64 desc=mp_assertcolvals - no desc provided,
65 outds=work.test_results
68 %mp_abort(iftrue= (&syscc ne 0)
70 ,msg=%str(syscc=&syscc - on macro entry)
73 %local lib ds col clib cds ccol nobs;
74 %let lib=%scan(&indscol,1,%str(.));
75 %let ds=%scan(&indscol,2,%str(.));
76 %let col=%scan(&indscol,3,%str(.));
77 %mp_abort(iftrue= (%mf_existds(&lib..&ds)=0)
79 ,msg=%str(&lib..&ds not found!)
82 %mp_abort(iftrue= (&checkvals=0)
84 ,msg=%str(Set CHECKVALS to a library.dataset.column containing check vals)
86 %let clib=%scan(&checkvals,1,%str(.));
87 %let cds=%scan(&checkvals,2,%str(.));
88 %let ccol=%scan(&checkvals,3,%str(.));
89 %mp_abort(iftrue= (%mf_existds(&clib..&cds)=0)
91 ,msg=%str(&clib..&cds not found!)
93 %let nobs=%mf_nobs(&clib..&cds);
94 %mp_abort(iftrue= (&nobs=0)
96 ,msg=%str(&clib..&cds is empty!)
99 %let test=%upcase(&test);
101 %
if &test ne ALLVALS and &test ne ANYVAL and &test ne NOVAL %then %
do;
104 msg=%str(Invalid test - &test)
112 select count(*) into: result trimmed
115 select &ccol from &clib..&cds
117 select count(*) into: orig trimmed from &lib..&ds;
120 %local notfound tmp1 tmp2;
121 %let tmp1=%mf_getuniquename();
122 %let tmp2=%mf_getuniquename();
130 select &ccol from &clib..&cds
137 select distinct &col into: notfound separated by ' ' from &tmp2;
140 %mp_abort(iftrue= (&syscc ne 0)
142 ,msg=%str(syscc=&syscc after macro query)
146 length test_description $256 test_result $4 test_comments $256;
147 test_description=symget('desc');
149 test_comments="&sysmacroname: &lib..&ds..&col has &result/&orig values "
150 !!"not in &clib..&cds..&ccol.. First 10 vals:"!!symget('notfound');
151 %if &test=ANYVAL %then %do;
152 if &result < &orig then test_result='PASS';
154 %else %if &test=ALLVALS %then %do;
155 if &result=0 then test_result='PASS';
157 %else %if &test=NOVAL %then %do;
158 if &result=&orig then test_result='PASS';
161 test_comments="&sysmacroname: Unsatisfied test condition - &test";
167 proc append base=&outds data=&ds;
172%mend mp_assertcolvals;