Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_getattrc.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_getattrc macro
4
5 <h4> SAS Macros </h4>
6 @li mf_getattrc.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12data work.attrc_test(label='numericlabel');
13 length numvar 8;
14 numvar=1;
15 output;
16run;
17
18%mp_assertscope(SNAPSHOT)
19%put scope check:%mf_getattrc(work.attrc_test,MTYPE);
20%mp_assertscope(COMPARE,
21 desc=Checking that mf_getattrc does not leak scope,
22 outds=work.test_results
23)
24
25%mp_assert(
26 iftrue=(%mf_getattrc(work.attrc_test,MTYPE)=DATA),
27 desc=Checking MTYPE returns DATA for a dataset,
28 outds=work.test_results
29)
30
31%mp_assert(
32 iftrue=(%mf_getattrc(work.attrc_test,LABEL)=numericlabel),
33 desc=Checking LABEL returns the label of the dataset,
34 outds=work.test_results
35)
36
37%mp_assert(
38 iftrue=(%mf_getattrc(work.attrc_test,LIB)=WORK),
39 desc=Checking LIB returns the library of the dataset,
40 outds=work.test_results
41)
42
43%mp_assert(
44 iftrue=(%mf_getattrc(work.no_such_dataset,MTYPE)=-1),
45 desc=Checking a dataset that cannot be opened returns -1,
46 outds=work.test_results
47)
48%let syscc=0;