Hi,
How to create SAS User Group in SMC (9.4) - Programmatically.
Thanks,
Sakthi
Check these documents, you have to use a combination of METADATA_NEWOBJ & METADATA_SETASSN functions.
SAS® 9.4 Language Interfaces to Metadata -> METADATA_NEWOBJ Function
https://go.documentation.sas.com/?docsetId=lrmeta&docsetTarget=p0ckrfx4pm9pj7n1x3x4e9ddx4cw.htm&docs...
SAS® 9.4 Language Interfaces to Metadata -> METADATA_SETASSN Function
https://go.documentation.sas.com/?docsetId=lrmeta&docsetTarget=p1pt2ddn2xhmaen1p5whdq58ithh.htm&docs...
Here is a description of type "Group": SAS(R) 9.4 Metadata Model: Reference -> Group
https://support.sas.com/documentation/cdl/en/omamodref/67417/HTML/default/viewer.htm#group.htm
What is your use case?
Sometimes it's better wit a data driven approach. Then you could use the %mdu-family of macros, which uses a canonical data model as interface.
Hi Simon,
Hope you are doing great.
I also wanted to add a specific group for a secured library datasets. I have already created the secure library successfully.
I also ran %mduextr(libref=MD1);
I also got N number of canonical tables, now I am just confused in which of those canonical tables I need to add the specific group.
Like, I need to run an insert into query for any one of that canonical table or what exactly should be taken care of I just wanted to know. Can you please help me if possible taking out few moments of your time!
Because I also want to know suppose I am able to add the group at one point of time, but after that can we give the permissions of read,write or execute programmatically ?? Or for permissions we need to touch the SMC to do that manually!!
Your help will be really appreciated.
Thanks....
I would recommend backing up your metadata before you do any changes programmatically, just in case something goes wrong. Is this a learning exercise or is it something you will continue to do regularly? I would only see this as a worthwhile approach if you need to do a lot of metadata changes.
Hi SASKiwi,
Can you please help me to add a Group for a secured library datasets programatically?
Your help will be really helpful for me.
I got the GRPMEMS table after running the %mduextr macro and inside that I got grpkeyID and MemkeyID. If I add a new row suppose in that table with a unique grpkeyID and MemkeyID will it be update the meatdata?
I am just wondering how I will find the unique key for new Group and besides to GRPMEMS table what other tables need to be updated.
Please help if possible. Thank in advance.
@rajdeep - This is not a straightforward process and it takes hours of development and careful testing. If this is a one-off requirement then just do it manually. It is a lot safer and quicker this way.
I found a solution to this.
./sas-set-metadata-access -profile "Admin" "/MBL Actual" -grant sas:Read,Write,ReadMetadata,WriteMetadata
./sas-set-metadata-access -profile "Admin" "/System/Secured Libraries/MBL" -grant sas:Read,Write,ReadMetadata,WriteMetadata
Batch Tool: sas-set-metadata-access
You can check the link. I think it's safe to do, because I tried and it's working.
@rajdeep - Good to see you found a way of doing this. For the level of maintenance we do in metadata I still find SAS Management Console the most efficient way of making changes.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.