Hi,
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.
Thanks
M
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.
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.
Thanks
M
Hi Peter,
can you provide me an example for autoexe. Do we have to make it a global option in the sas program and run it?
Thanks
M
@Malathi13: It's just a txt file that contains SAS statements. See: http://support.sas.com/kb/19/244.html
HTH,
Art, CEO, AnalystFinder.com
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.