In SAS 9 we could use SAS code to query metadata for group membership information (eg with a macro like this).
In Viya / SPRE, what would be an equivalent approach? Presuming XCMD is disabled.
Hey Alan, @AllanBowe ,
having in mind how SAS Viya works:
a- group memberships come from AD, except for the Custom Groups
b- SAS Viya works with Rest APIs
c- the Rest APIs contain methods to retrieve the memberships
d- you don't need XCMD to call a restAPI (that is the magic of rest APIs)
e- you can use JSON files to be sent to the rest APIs
I have not tried yet this particular method but I think it safe to assume you can run proc htttp,soap and or JSON to interact with the Rest APIs from "simple" SAS code.
However, and to be fair, I could not see a specific identity membership Rest request in https://developer.sas.com/apis/rest/CoreServices/
Pity
But...! SAS has made available as well https://github.com/sassoftware/pyviyatools
In there, I can see a https://github.com/sassoftware/pyviyatools/blob/master/listgroupsandmembers.py
And if I am correct, all should go down to use the /identities/groups and /identities/groups/'+groupid+'/members Rest APIs
Cheers,
Juan
Hey Juan!
Yes, I figured it must be a REST API to obtain an AD group listing, but like you, couldn't see it in the docs. Good spot finding it in the python repo! Will try out those endpoints..
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.