46 outds=work.ms_getgroups,
53 ,msg=%str(syscc=&syscc on macro entry)
56%local fref0 fref1 libref optval rc msg url;
58%
if %sysget(MODE)=desktop %then %
do;
61 length NAME $32 DESCRIPTION $256. GROUPID 8;
63 description=
"&sysuserid (group - desktop mode)";
71%let fref0=%mf_getuniquefileref();
72%let fref1=%mf_getuniquefileref();
73%let libref=%mf_getuniquelibref();
76%let optval=%sysfunc(getoption(bomfile));
80 file &fref0 lrecl=1000;
81 infile
"&_sasjs_tokenfile" lrecl=1000;
83 if _n_=1 then put
"accept: application/json";
87%
if &mdebug=1 %then %
do;
95%
if "&user" ne
"0" %then %let url=/SASjsApi/user/by/username/&user;
96%
else %
if "&uid" ne
"0" %then %let url=/SASjsApi/user/&uid;
97%
else %let url=/SASjsApi/group;
100proc http method=
'GET' headerin=&fref0 out=&fref1
101 url=
"&_sasjs_apiserverurl.&url";
102%
if &mdebug=1 %then %
do;
109 ,mac=ms_getgroups.sas
110 ,msg=%str(Issue submitting GET query to SASjsApi)
113libname &libref JSON fileref=&fref1;
115%
if "&user"=
"0" and
"&uid"=
"0" %then %
do;
117 length NAME $32 DESCRIPTION $256. GROUPID 8;
118 if _n_=1 then call missing(of _all_);
125 length NAME $32 DESCRIPTION $256. GROUPID 8;
126 if _n_=1 then call missing(of _all_);
134 ,mac=ms_getgroups.sas
135 ,msg=%str(Issue reading response JSON)
141%
if &mdebug=1 %then %
do;
142 filename &fref0 clear;
143 filename &fref1 clear;
144 libname &libref clear;