Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_existfeature.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_existfeature macro
4
5 <h4> SAS Macros </h4>
6 @li mf_existfeature.sas
7 @li mf_getplatform.sas
8 @li mp_assert.sas
9 @li mp_assertscope.sas
10
11**/
12
13/* Viya (4.x) and CAS (5.x) answer 0 for these two features - see the macro */
14%if %substr(&sysver,1,1)=4 or %substr(&sysver,1,1)=5 %then %do;
15 %let expect_colcons=0;
16 %let expect_memtype=0;
17%end;
18%else %do;
19 %let expect_colcons=1;
20 %let expect_memtype=1;
21%end;
22
23%mp_assertscope(SNAPSHOT)
24%put scope check:%mf_existfeature(COLCONSTRAINTS) on %mf_getplatform();
25%mp_assertscope(COMPARE,
26 desc=Checking that mf_existfeature does not leak scope,
27 outds=work.test_results
28)
29
30%mp_assert(
31 iftrue=(%mf_existfeature(COLCONSTRAINTS)=&expect_colcons),
32 desc=Checking that column constraints are detected on SAS 9.4 and above,
33 outds=work.test_results
34)
35
36%mp_assert(
37 iftrue=(%mf_existfeature(DBMS_MEMTYPE)=&expect_memtype),
38 desc=Checking that dbms_memtype is detected on SAS 9.4 and above,
39 outds=work.test_results
40)
41
42%mp_assert(
43 iftrue=(%mf_existfeature(NOSUCHFEATURE)=-1),
44 desc=Checking that an unknown feature returns -1,
45 outds=work.test_results
46)
47
48%mp_assert(
49 iftrue=(%index(01,%mf_existfeature(PROCLUA))>0),
50 desc=Checking that PROCLUA answers 0 or 1 according to the environment,
51 outds=work.test_results
52)
53
54%mp_assert(
55 iftrue=(%index(01,%mf_existfeature(EXPORTXLS))>0),
56 desc=Checking that EXPORTXLS answers 0 or 1 according to the environment,
57 outds=work.test_results
58)