Architecting, installing and maintaining your SAS environment

META libname engine and DI Studio

Reply
Contributor
Posts: 47

META libname engine and DI Studio

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

Trusted Advisor
Posts: 1,314

Re: META libname engine and DI Studio

Posted in reply to tammy_dezilva

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).

 

 

 

 

Contributor
Posts: 47

Re: META libname engine and DI Studio

Posted in reply to JuanS_OCS
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
Super User
Posts: 5,431

Re: META libname engine and DI Studio

Posted in reply to tammy_dezilva

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

Data never sleeps
Contributor
Posts: 47

Re: META libname engine and DI Studio

We want to utilise metadata security and pre-assigning just utilises file system security for the tables within the library.
Super User
Posts: 3,256

Re: META libname engine and DI Studio

Posted in reply to tammy_dezilva

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. 

Contributor
Posts: 47

Re: META libname engine and DI Studio

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
Super User
Posts: 3,256

Re: META libname engine and DI Studio

[ Edited ]
Posted in reply to tammy_dezilva

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;

 

 

SAS Super FREQ
Posts: 299

Re: META libname engine and DI Studio

Posted in reply to tammy_dezilva

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

 

 

Contributor
Posts: 47

Re: META libname engine and DI Studio

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.

SAS Super FREQ
Posts: 299

Re: META libname engine and DI Studio

Posted in reply to tammy_dezilva

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?

Ask a Question
Discussion stats
  • 10 replies
  • 738 views
  • 2 likes
  • 5 in conversation