Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_verifymacvars.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_verifymacvars macro
4
5 <h4> SAS Macros </h4>
6 @li mf_verifymacvars.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12%let var1=x;
13%let var2=y;
14
15%mp_assertscope(SNAPSHOT)
16%mp_assert(
17 iftrue=(%mf_verifymacvars(var1 var2)=1),
18 desc=Checking macvars exist,
19 outds=work.test_results
20)
21%mp_assertscope(COMPARE)
22
23
24/* an mf_ macro returns a value rather than ending the step: a failure has to
25 come back as 0, with the reason in the log, and must not abort */
26%mp_assert(
27 iftrue=(%mf_verifymacvars(nosuchvar_intentional, mAbort=YES)=0),
28 desc=Checking a missing macvar returns 0 even with mAbort=YES,
29 outds=work.test_results
30)
31%mp_assert(
32 iftrue=(&syscc=0),
33 desc=Checking the failure path leaves syscc alone,
34 outds=work.test_results
35)