Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_getvarcount.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_getvarlist macro
4
5 <h4> SAS Macros </h4>
6 @li mf_getvarcount.sas
7 @li mp_assertscope.sas
8
9**/
10
11data work.all work.nums(keep=num1 num2) work.chars(keep=char1 char2);
12 length num1 num2 8 char1 char2 char3 $4;
13 call missing (of _all_);
14 output;
15run;
16
17%mp_assertscope(SNAPSHOT)
18%put scope check:%mf_getvarcount(work.all);
19%mp_assertscope(COMPARE)
20
21%mp_assert(
22 iftrue=(%mf_getvarcount(work.all)=5),
23 desc=%str(Checking for mixed vars),
24 outds=work.test_results
25)
26%mp_assert(
27 iftrue=(%mf_getvarcount(work.all,typefilter=C)=3),
28 desc=%str(Checking for char in mixed vars),
29 outds=work.test_results
30)
31%mp_assert(
32 iftrue=(%mf_getvarcount(work.all,typefilter=N)=2),
33 desc=%str(Checking for num in mixed vars),
34 outds=work.test_results
35)
36%mp_assert(
37 iftrue=(%mf_getvarcount(work.nums,typefilter=c)=0),
38 desc=%str(Checking for char in num vars),
39 outds=work.test_results
40)
41%mp_assert(
42 iftrue=(%mf_getvarcount(work.chars,typefilter=N)=0),
43 desc=%str(Checking for num in char vars),
44 outds=work.test_results
45)
46