Macros for SAS Application Developers
https://github.com/sasjs/core
ms_creategroup.test.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Testing ms_creategroup.sas macro
4 
5  <h4> SAS Macros </h4>
6  @li mf_getuniquename.sas
7  @li mp_assert.sas
8  @li mp_assertscope.sas
9  @li ms_creategroup.sas
10  @li ms_getgroups.sas
11 
12 **/
13 
14 %let group=%substr(%mf_getuniquename(),1,8);
15 
16 %mp_assertscope(SNAPSHOT)
17 %ms_creategroup(&group, desc=The description,mdebug=&sasjs_mdebug,outds=test1)
18 %mp_assertscope(COMPARE
19  ,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN
20 )
21 
22 %let id=0;
23 data _null_;
24  set work.test1;
25  call symputx('id',groupid);
26 run;
27 %mp_assert(
28  iftrue=(&id>0),
29  desc=Checking that group was created with an ID,
30  outds=work.test_results
31 )
32 
33 /* double check by querying the list of users */
34 %ms_getgroups(outds=work.test2)
35 %let checkid=0;
36 data _null_;
37  set work.test2;
38  where upcase(name)="%upcase(&group)";
39  call symputx('checkid',groupid);
40 run;
41 %mp_assert(
42  iftrue=(&checkid=&id),
43  desc=Checking that fetched group exists and has the same ID,
44  outds=work.test_results
45 )
46 
47 
48 
49 
50