Hi Team,
I am using the below PROC Meta data code for adding / removing the access to user group for a user(colleague), but getting an error due to a special character in the group name.
Code used :
proc metadata in=
"<UpdateMetadata>
<Metadata>
<Person Id=%str(%')&PersonId%str(%')>
<IdentityGroups Function=&FUNC>
<IdentityGroup ObjRef=%str(%')&GroupId%str(%') Name=%str(%')&Group%str(%')/>
</IdentityGroups>
</Person>
</Metadata>
<ReposId>$METAREPOSITORY</ReposId>
<ns>SAS</ns>
<flags>268435456</flags>
<Options/>
</UpdateMetadata>";
run;
Error Snapshot:
Can anyone help me with a solution to fix this ?
thanks in advance
thalla
Looks like one of your user group names includes a quote. You should fix this at source to not contain quotes. Defining user groups containing quotes is just bad practice.
As @SASKiwi says, I think you're only going to get trouble if you allow single quotes in the Group name.
However, maybe as a temporary work around you could try coding a %BQUOTE around the Group name. I still think you may have trouble though down the road. Use at you own risk.
"<UpdateMetadata>
<Metadata>
<Person Id=%str(%')&PersonId%str(%')>
<IdentityGroups Function=&FUNC>
<IdentityGroup ObjRef=%str(%')&GroupId%str(%') Name=%str(%')%BQUOTE(&Group)%str(%')/>
</IdentityGroups>
</Person>
</Metadata>
<ReposId>$METAREPOSITORY</ReposId>
<ns>SAS</ns>
<flags>268435456</flags>
<Options/>
</UpdateMetadata>";
Jim
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.