BookmarkSubscribeRSS Feed
aman_rai02
Calcite | Level 5

Hi,

Me and my teammates are trying to create Libraries for two different user IDs, for eg: A and B.

We are doing this in the SAS Management Console. We want the names of all the Libraries in these respective IDs to be the same, but the data is different for A and B. We had this setup before but now it is lost. Even after giving different file paths, we are getting the same data as in 'A' to all the other IDs.

Why is it not working, can someone help?

3 REPLIES 3
gwootton
SAS Super FREQ
It sounds like both user A and B have ReadMetadata permission on the library defined for user A, so they are all assigning the library for user A. If you modify the Metadata permissions such that user A only has ReadMetadata permission on the library for themselves and none of the other libraries, and similarly for user B, they should assign as expected.
--
Greg Wootton | Principal Systems Technical Support Engineer
Patrick
Opal | Level 21

What @gwootton proposes could work but you would end-up with multiple metadata library definitions that all have the same metadata name and libref. For any user with some sort of admin rights that provide read access to more than one of these library definitions the result will still be "random" which library metadata definition will get picked. I consider such duplicates in SAS Metadata as not recommended and it created issues for me in the past for example when using SAS DI Studio.

 

What you could do instead:

1. Define the library in metadata once with a dummy pathname and as pre-assigned (pre-assigned so SAS DIS doesn't create the libname statement when deploying the code).

2. Add logic to the the usermods autoexec where you issue a libname statement with a path depending on the user who invokes the SAS session. You could of course in this autoexec syntax also query SAS Metadata (or OS) to determine to which group a user belongs and then use a path based on group membership and not individual user.

 

The libname statement in the autoexec will overwrite the libname defined in SAS Metadata with the same libref.

Sajid01
Meteorite | Level 14

Hello @aman_rai02 
As I understand it, you are using path based libraries. Make sure permissions particularly write permissions are enforced at OS level regardless of the approach that is being followed to create libraries.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Discussion stats
  • 3 replies
  • 1492 views
  • 4 likes
  • 4 in conversation