BookmarkSubscribeRSS Feed
tammy_dezilva
Quartz | Level 8

Hi

 

I have recently created some SAS libraries which are not pre-assigned and then updated the autoexec  to preassign them using the meta libname engine.  When creating a job in DI studio, SAS then automatically adds a libname statement to the generated code, using the BASE engine.  This is fine when the job is running in production, but when we are doing development we are needing to redirect where the library points to.  Previously when we used preassigned libraries, we used to be able to update the autoexec to point to a different location when needed.  We sometimes have two developers accessing tables in the one library so they need to access two different copies of the library instead.  The problem now is that DI studio automatically assigns the libname in the job so we cannot redirect it to a different location.  Does anyone know a way around this?  or to stop DI studio from doing these libname statements as they're in the autoexec anyway so are unnecessary.

 

 

thanks

Tammy

10 REPLIES 10
JuanS_OCS
Amethyst | Level 16

Hi,

 

about your problem related to several users pointing to the same library: you don't need extra library definitions or locations, ir you license and install SAS/SHARE. 

 

About the general question, you could include a variable on the library definition. In that case, the variable can be initialized on your autoexec and take the value you really need on each SAS session (one user, another user, development, production, even another server, etc).

 

 

 

 

tammy_dezilva
Quartz | Level 8
Great idea Juan. I too have done this at a previous workplace but didn't even think of doing that now for some reason. Thanks
LinusH
Tourmaline | Level 20

Why aren't you marking them as pre-assigned when they are?

Data never sleeps
tammy_dezilva
Quartz | Level 8
We want to utilise metadata security and pre-assigning just utilises file system security for the tables within the library.
SASKiwi
PROC Star

The way we handle having separate Production and Development environments is by having two SAS Application servers running, one with pre-assigned libraries in metadata pointing at Prod locations, and the other pointing at Dev locations. The LIBREFs are all the same.

 

If you had this setup then you just point DI Studio to Prod SASApp to run in Prod or to Dev SASApp to run in Dev. No change in autoexecs or code is required. 

tammy_dezilva
Quartz | Level 8
Thanks SASKiwi. As we could have two developers needing the one development library at once in development, I guess we would therefore need to have two dev app servers then to utilise this solution then? Interesting idea. I will try the macro variable solution mentioned by Juan first and see how that goes. Thanks
SASKiwi
PROC Star

We have multiple developers working in our one App server Dev environment also. We use change control software to manage the software changes (highly recommended) and as long as they are not working on changes to the same tables at the same time we find it works pretty well.

 

We also use macro a lot but not for data source definitions, more for locations of code, input and output folders. Again Prod mirrors Dev, so we just have a macro variable which defines which one you are working in. Conveniently we have file shares Prod$ for Prod, Dev$ for Dev so the environment macro variable is either set to Prod$ or Dev$. We define the directories something like this (Windows example):

 

%let Server = ServerName;
%let Env = Prod;
%let AppDir = \\&Server.\&Env.$\MyAppdir;

 

 

anja
SAS Employee

Hi,

 

are prod and dev two different machines, each running their own Metadata Server and App servers,

or, is it one Metadata Server, separating prod and dev by SAS Folders?.

 

Thanks

Anja

 

 

tammy_dezilva
Quartz | Level 8

We're just in the process of getting a proper dev environment set up but it will just be separate folders on the existing servers.

anja
SAS Employee

So you will have 2 metadata servers?

 

If so, do both developers have metadata identities in both environments? I am asking these questions because

I am wondering if seting up a SAS Folder and assigning groups with certain permissions might help the

situation.

 

The problem is not really the pre-assignment but the fact that 2 people need to access the same table at the same time.

Is that a fair statement?

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 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 2624 views
  • 2 likes
  • 5 in conversation