38%macro ms_adduser2group(uid=0
40 ,outds=work.ms_adduser2group
46 ,mac=ms_adduser2group.sas
47 ,msg=%str(syscc=&syscc on macro entry)
50%local fref0 fref1 fref2 libref optval rc msg;
51%let fref0=%mf_getuniquefileref();
52%let fref1=%mf_getuniquefileref();
53%let libref=%mf_getuniquelibref();
56%let optval=%sysfunc(getoption(bomfile));
60 file &fref0 lrecl=1000;
61 infile
"&_sasjs_tokenfile" lrecl=1000;
63 if _n_=1 then put
"accept: application/json";
67%
if &mdebug=1 %then %
do;
76proc http method=
'POST' headerin=&fref0 out=&fref1
77 url=
"&_sasjs_apiserverurl/SASjsApi/group/&gid/&uid";
78%
if &mdebug=1 %then %
do;
85 ,mac=ms_adduser2group.sas
86 ,msg=%str(Issue submitting query to SASjsApi/group)
89libname &libref JSON fileref=&fref1;
93 drop ordinal_root ordinal_users;
94%
if &mdebug=1 %then %
do;
102 ,mac=ms_creategroup.sas
103 ,msg=%str(Issue reading response JSON)
109%
if &mdebug=0 %then %
do;
110 filename &fref0 clear;
111 filename &fref1 clear;
112 libname &libref clear;
122%mend ms_adduser2group;