BookmarkSubscribeRSS Feed
Fluorite | Level 6
Hi Cris,

How users were added and their respective permissions on folders and reports in VA, but we just saw that it is currently incorrect and we would like to change user permissions for folders and VA reports for all.
Researching we saw a possibility using SAS GUIDE but we did not get an efficient way.

original code

libname dirm 'S:\pgms\metalib';

%let mypw={ }

options metaserver = ""
metaport = 8561
metauser = ""
metapass = ""
metarepository = Foundation
metaprotocol = bridge

libname dirm 'F:\SAS_DATASETS\pgms\metalib';
libname dirt 'F:\SAS_DATASETS\pgms\metalib_target';
libname dirc 'F:\SAS_DATASETS\pgms\metalib_change';
libname dira 'F:\SAS_DATASETS\pgms\metalib_aplicar';


proc sql;
create table VA_Grupos as
select NOME_GRUPO, Login_Usuario, displayname, memDesc, title from
(select memid, name as NOME_GRUPO, memName as Login_Usuario, memDesc from dirm.Groupmempersons_info) as a left join
(select objid, title, displayname from dirm.person) as b on a.memid=b.objid
order by NOME_GRUPO, displayname;

proc sql;
create table VA_Usuarios as
select keyid, displayname, name, description,title from dirm.person
order by displayname;

%mducmp(master=dirm, target=dirt, change=dirc);

proc sql;
create table grpmems as select * from dirm.Grpmems where grpkeyid='A5MZOL7U.A50000JG' and memkeyid='Larissa_Braga';quit;

proc sql;
insert into dirm.Grpmems select * from grpmems;quit;


%mdsecds(folder="/Fonte_de_Dados/", includesubfolders=yes);

%mdsecds(identitynames="sasdemo,PUBLIC", identitytypes="Person,IdentityGroup",
membertypes="Report", perms="WriteMetadata");

%mdsecds(identitynames="jose_ramos", identitytypes="Person", membertypes="Library",

Tourmaline | Level 20
So you want to set or reset the permissions programmatically?
Maybe change the title to describe the question more explicitly?
Moving the question to VA community.
Opal | Level 21

Updating SAS metadata is best done in SAS DATA steps, not in SQL, as you have a lot more control and can use the metadata read and update functions.


Here is the SAS Guide for this: Metadata Interface Guide 


Please bear in mind that the metadata data model is horribly complicated, and unraveling it is a steep learning curve. There is always the danger of corrupting the metadata repository if your updates don't work correctly. You should ALWAYS create a backup before you update - easy to do in SMC.


Personally I prefer to stick to configuring metadata in SMC. It's a lot easier and a lot less dangerous. However I'm lucky in that we only have a small number of SAS users so manual maintenance does not take long.


If you have a LOT of SAS users then automated metadata updates make a lot more sense. In this case you should be syncing your metadata users from Active Directory or Unix equivalent as that will save a huge amount of work and possibly avoid some of the permissions errors you are seeing. SAS provides programs for doing this.


Fluorite | Level 6
exactly what programs does sas offer so that it can serve as support i am grateful!
Opal | Level 21

@lgsucupira  - The link I sent you contains examples of reading and updating SAS metadata. They are a good place to start. I also suggest you Google for SAS metadata examples also. The only supported programs I'm aware of are those mentioned in the documentation and the LDAP / AD account synchronisation with SAS metadata:




Fluorite | Level 6
Hi SASKiwi
thank you very much, I am studying the content of the link, maybe I need some more help
Opal | Level 21

@lgsucupira - I have yet to find many use cases where the long and steep learning curve is worth it 😃. Good luck! Also please note that if you are planning to move to SAS Viya in the near future like many SAS users then the problem disappears - there is no metadata in Viya. We are planning such a move ourselves so it is pointless for us to spend a lot of time on understanding metadata structure.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1 like
  • 3 in conversation