47%macro mp_assertdsobs(inds,
49 desc=Testing observations,
50 outds=work.test_results
54 %let nobs=%mf_nobs(&inds);
55 %let test=%upcase(&test);
56 %let ds=%mf_getuniquename(prefix=mp_assertdsobs);
58 %
if %substr(&test.xxxxx,1,6)=EQUALS %then %
do;
59 %let val=%scan(&test,2,%str( ));
60 %mp_abort(iftrue= (%DATATYP(&val)=CHAR)
62 ,msg=%str(Invalid test - &test, expected EQUALS [integer])
66 %
else %
if %substr(&test.xxxxxxx,1,7)=ATLEAST %then %
do;
67 %let val=%scan(&test,2,%str( ));
68 %mp_abort(iftrue= (%DATATYP(&val)=CHAR)
70 ,msg=%str(Invalid test - &test, expected ATLEAST [integer])
74 %
else %
if %substr(&test.xxxxxxx,1,7)=ATMOST %then %
do;
75 %let val=%scan(&test,2,%str( ));
76 %mp_abort(iftrue= (%DATATYP(&val)=CHAR)
78 ,msg=%str(Invalid test - &test, expected ATMOST [integer])
82 %
else %
if &test ne HASOBS and &test ne EMPTY %then %
do;
85 msg=%str(Invalid test - &test)
90 length test_description $256 test_result $4 test_comments $256;
91 test_description=symget(
'desc');
93 test_comments=
"&sysmacroname: Dataset &inds has &nobs observations.";
94 test_comments=test_comments!!
" Test was "!!symget(
'test');
95 %
if &test=HASOBS %then %
do;
96 if &nobs>0 then test_result=
'PASS';
98 %
else %
if &test=EMPTY %then %
do;
99 if &nobs=0 then test_result=
'PASS';
101 %
else %
if &test=EQUALS %then %
do;
102 if &nobs=&val then test_result=
'PASS';
104 %
else %
if &test=ATLEAST %then %
do;
105 if &nobs ge &val then test_result=
'PASS';
107 %
else %
if &test=ATMOST %then %
do;
108 if &nobs le &val then test_result=
'PASS';
111 test_comments=
"&sysmacroname: Unsatisfied test condition - &test";
115 proc append base=&outds data=&ds;