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 MC0_JADP1LEN
20 MC0_JADPNUM MC0_JADVLEN
21)
22
23%let id=0;
24data _null_;
25 set work.test1;
26 call symputx('id',id);
27 putlog (_all_)(=);
28run;
29%mp_assert(
30 iftrue=(&id>0),
31 desc=Checking that user was created with an ID,
32 outds=work.test_results
33)
34
35/* double check by querying the list of users */
36%ms_getusers(outds=work.test2)
37%let checkid=0;
38data _null_;
39 set work.test2;
40 if _n_<20 then putlog (_all_)(=);
41 if upcase(username)="%upcase(&user)";
42 call symputx('checkid',id);
43run;
44%mp_assert(
45 iftrue=(&checkid=&id),
46 desc=Checking that fetched user exists and has the same ID,
47 outds=work.test_results
48)
49
50
51
52
53