46 outds=work.ms_getusers,
55 ,msg=%str(syscc=&syscc on macro entry)
58%local fref0 fref1 libref optval rc msg url;
59%let fref0=%mf_getuniquefileref();
60%let fref1=%mf_getuniquefileref();
61%let libref=%mf_getuniquelibref();
63%
if %sysget(MODE)=desktop %then %
do;
66 length DISPLAYNAME $60 USERNAME:$30 ID 8;
67 USERNAME=
"&sysuserid";
68 DISPLAYNAME=
"&sysuserid (desktop mode)";
77%let optval=%sysfunc(getoption(bomfile));
81 file &fref0 lrecl=1000;
82 infile
"&_sasjs_tokenfile" lrecl=1000;
84 if _n_=1 then put
"accept: application/json";
88%
if &mdebug=1 %then %
do;
96%
if "&group" ne
"0" %then %let url=/SASjsApi/group/by/groupname/&group;
97%
else %
if "&gid" ne
"0" %then %let url=/SASjsApi/group/&gid;
98%
else %let url=/SASjsApi/user;
100proc http method=
'GET' headerin=&fref0 out=&fref1
101 url=
"&_sasjs_apiserverurl.&url";
102%
if &mdebug=1 %then %
do;
111 ,msg=%str(Issue submitting API query)
114libname &libref JSON fileref=&fref1;
116%
if "&group"=
"0" and
"&gid"=
"0" %then %
do;
118 length DISPLAYNAME $60 USERNAME:$30 ID 8;
119 if nobs=0 then call missing(of _all_);
120 set &libref..root nobs=nobs;
126 length DISPLAYNAME $60 USERNAME:$30 ID 8;
127 if nobs=0 then call missing(of _all_);
128 set &libref..users nobs=nobs;
129 drop ordinal_root ordinal_users;
136 ,msg=%str(Issue reading response JSON)
142%
if &mdebug=1 %then %
do;
143 filename &fref0 clear;
144 filename &fref1 clear;
145 libname &libref clear;