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 mf_getuniquename.sas
7 @li mp_assert.sas
8 @li mp_assertdsobs.sas
9 @li mp_assertscope.sas
10 @li ms_adduser2group.sas
11 @li ms_creategroup.sas
12 @li ms_getusers.sas
13
14**/
15
16
17%mp_assertscope(SNAPSHOT)
18%ms_getusers(outds=work.test1,mdebug=&sasjs_mdebug)
19%mp_assertscope(COMPARE
20 ,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN MC0_JADP1LEN
21 MC0_JADPNUM MC0_JADVLEN
22)
23
24%mp_assertdsobs(work.test1,test=ATLEAST 1)
25
26/**
27 * test the extraction of group members
28 */
29
30/* create a group */
31%let group=%substr(%mf_getuniquename(),1,8);
32%ms_creategroup(&group, desc=some desc,mdebug=&sasjs_mdebug,outds=work.group)
33%let gid=0;
34data _null_;
35 set work.group;
36 call symputx('gid',groupid);
37run;
38
39/* add a member */
40%ms_adduser2group(uid=1,gid=&gid)
41
42/* extract the members */
43%ms_getusers(group=&group,outds=test2)
44
45/* check the user is in the output list */
46%let checkid=0;
47data _null_;
48 set work.test2;
49 if id=1 then call symputx('checkid',1);
50run;
51%mp_assert(
52 iftrue=(&checkid=1),
53 desc=Checking that admin user was created in the new group,
54 outds=work.test_results
55)
56
57
58
59
60
61