Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
ms_createuser.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing ms_createuser.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_createuser.sas
10 @li ms_getusers.sas
11
12**/
13
14%let user=%substr(%mf_getuniquename(),1,8);
15
16%mp_assertscope(SNAPSHOT)
17%ms_createuser(&user,passwrd,outds=test1,mdebug=&sasjs_mdebug)
18%mp_assertscope(COMPARE
19 ,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN
20)
21
22%let id=0;
23data _null_;
24 set work.test1;
25 call symputx('id',id);
26 putlog (_all_)(=);
27run;
28%mp_assert(
29 iftrue=(&id>0),
30 desc=Checking that user was created with an ID,
31 outds=work.test_results
32)
33
34/* double check by querying the list of users */
35%ms_getusers(outds=work.test2)
36%let checkid=0;
37data _null_;
38 set work.test2;
39 if _n_<20 then putlog (_all_)(=);
40 if upcase(username)="%upcase(&user)";
41 call symputx('checkid',id);
42run;
43%mp_assert(
44 iftrue=(&checkid=&id),
45 desc=Checking that fetched user exists and has the same ID,
46 outds=work.test_results
47)
48
49
50
51
52