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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.