BookmarkSubscribeRSS Feed
THALLA_REDDY
Obsidian | Level 7

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:

 

THALLA_REDDY_0-1627666745682.png

 

Can anyone help me with a solution to fix this ?

 

thanks in advance

thalla

2 REPLIES 2
SASKiwi
PROC Star

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. 

jimbarbour
Meteorite | Level 14

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 823 views
  • 0 likes
  • 3 in conversation