Hi @Criptic
It might not fully answer your needs but hopefully it will assist you.
EG has some macro-variables you can use.
To display them all, you can simply run:
%put _all_;
One of the macro-variable is SYSUSERID.
%put &SYSUSERID; returns the user ID (sasdemo in that case):
26 %put &SYSUSERID; sasdemo
With that code (you can take of the options statement if you are already connected to the Metadata Server), you'll have the authentication domains linked to the user. If you have more than one, that's the caveat, you'll have few listed...
options metaserver="your server"
metaport=8561
metauser="sasadm@saspw"
metapass="your password"
metarepository="Foundation"
metaprotocol=BRIDGE;
%put &SYSUSERID;
%let person=&SYSUSERID;
data logins;
length userid $32 person uri authuri obj authdomain $256 id $17;
Userid="";
person="";
keep userid person uri id obj authdomain;
obj="omsobj:Person?@Name='"||"&person"||"'";
arc=metadata_getattr(obj,"ID",id);
arc=metadata_getattr(obj,"Name",person);
rc=1;
n=1;
association='';
put arc= id= obj=;
if (arc=-3) then put "No Persons match (&person).";
else do;
rc=metadata_getnasn(obj,"Logins",
n,
uri);
if (rc > 0) then do i=1 to rc;
/* Walk through all possible associations of this object. */
arc=metadata_getnasn(obj,"Logins",
i,
uri);
put rc=;
arc = metadata_getattr(uri, "UserID", Userid);
arc2=metadata_getnasn(uri,"Domain",
1,
authuri);
*put arc2= authuri=;
arc2= metadata_getattr(authuri, "Name", authdomain);
put 'Userid=' UserID $32.;
put authdomain=;
output;
put uri=;
end;
Else put "There are no logins for &person";
end;
run;
proc print data=logins;
var person userid authdomain;
run;
Hope that helps.
Cheers, Damo
... View more