Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_nobs.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_nobs macro
4
5 <h4> SAS Macros </h4>
6 @li mf_nobs.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12data work.nobs_test;
13 do i=1 to 3;
14 output;
15 end;
16run;
17
18/* a dataset that exists but holds no observations */
19data work.nobs_zero;
20 x=1;
21 stop;
22run;
23
24%mp_assertscope(SNAPSHOT)
25%put scope check:%mf_nobs(work.nobs_test);
26%mp_assertscope(COMPARE,
27 desc=Checking that mf_nobs does not leak scope,
28 outds=work.test_results
29)
30
31%mp_assert(
32 iftrue=(%mf_nobs(work.nobs_test)=3),
33 desc=Checking the observation count of a populated dataset,
34 outds=work.test_results
35)
36
37%mp_assert(
38 iftrue=(%mf_nobs(work.nobs_zero)=0),
39 desc=Checking that an empty dataset returns zero,
40 outds=work.test_results
41)