Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
ms_getusers.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing ms_getusers.sas macro
4
5 <h4> SAS Macros </h4>
6 @li ms_creategroup.sas
7 @li ms_adduser2group.sas
8 @li ms_getusers.sas
9 @li mp_assertdsobs.sas
10 @li mp_assertscope.sas
11
12**/
13
14
15%mp_assertscope(SNAPSHOT)
16%ms_getusers(outds=work.test1,mdebug=&sasjs_mdebug)
17%mp_assertscope(COMPARE
18 ,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN MC0_JADP1LEN
19 MC0_JADPNUM MC0_JADVLEN
20)
21
22%mp_assertdsobs(work.test1,test=ATLEAST 1)
23
24/**
25 * test the extraction of group members
26 */
27
28/* create a group */
29%let group=%substr(%mf_getuniquename(),1,8);
30%ms_creategroup(&group, desc=some desc,mdebug=&sasjs_mdebug,outds=work.group)
31%let gid=0;
32data _null_;
33 set work.group;
34 call symputx('gid',groupid);
35run;
36
37/* add a member */
38%ms_adduser2group(uid=1,gid=&gid)
39
40/* extract the members */
41%ms_getusers(group=&group,outds=test2)
42
43/* check the user is in the output list */
44%let checkid=0;
45data _null_;
46 set work.test2;
47 if id=1 then call symputx('checkid',1);
48run;
49%mp_assert(
50 iftrue=(&checkid=1),
51 desc=Checking that admin user was created in the new group,
52 outds=work.test_results
53)
54
55
56
57
58
59