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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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