02-14-2017 04:45 PM
I'm trying to store all my libraries in one %includes statement, I did that before but unable to think how I did that.
Here is an example of my libraries in sas 9.4.
libname A "C:\\desktop\toys";
libname B "C:\\desktop\price";
libname C "C:\\desktop\orders";
I want to put all these libraries in %include so that I can just use one %include statement in my programs to access all these libraries instead of mentioning all the libraries again in the program.
Can anyone help me in this? I know it is very simple and easy but unable to figure out how I did before.
02-14-2017 04:54 PM
Create a SAS program that contains all your library definitions.
Then use %include to that program whenever you want to assign all libraries.
If you're looking for this to occur automatically when you start SAS you need to modify your autoexec or config file. Usually you'll have access to an Autoexec but not necessarily the config file.
02-14-2017 05:04 PM
Thank you Reeza, I figured out using %include immediately after posting it. Thank you for the automatic running of %include which I'll try and see if I can get it as I like the idea of making it run automatically when I start SAS.
02-15-2017 04:52 PM
Whatever you add to an autoexec will get executed during SAS startup and will be applicable always.
For library assignments: You can do this in an autoexec but I'm kind of astonished that no one mentioned to do such an assignment via SAS Metadata Server (using SAS Management Console) as that's the place where this normally is done in a corporate environment.
Using SAS Metadata also allows you to only get such assignments executed for certain metadata groups (ie. a department) and not the whole company.
Managing such company level SAS configurations is a SAS Administrator task. Contact yours if you've got such requirements.