How do I assign a folder called myfiles to the permanent library sasuser.
The folder myfiles is on my desktop and it contains datasets. I want the folder to be assigned in the permanent library sasuser. So everytime I open SAS, I see myfiles folder in the SASUSER library.
I tried one way of doing it. But, I want the effiecient way of assigning the folder to SASUSER library.
I did like this:
libname x "path";
data sasuser.dataset1;
set x.dataset1;
run;
I tried doing the below statement but did not work;
libname sasuser.myfiles 'path';
SASUSER is a libname created by the SAS system to point to its metadata files, you do Not want to change that as it will break your whole system. If you want to have user created libnames at the start of each session then you put them in the startup files - for Base SAS this is the autoexec.sas, which is the file that is loaded upon creating a new session and any code in there will be executed before you get the interactive window.
A library cannot contain another library. Libraries only contain members (datasets, views, catalogs).
Echo with @RW9. You don't want to mess around those SAS factory folders. If you absoultely 'have to' to do it, depending on your SAS deployment and your access permission, try following at your own risk:
1. Locate your SAS config file, for local deployment, you may find it some where like:
C:\Program Files\SASHome2\x86\SASFoundation\9.4\nls\en\sasv9.cfg
2. Open it with a text editor (e.g. notepad), find the following line (it could be completely different depending on your deployment)
-SASUSER "?FOLDERID_Documents\My SAS Files\9.4"
3. Modify it to (not in literal):
-SASUSER "your myfiles path"
4. Save it and restart your SAS.
Haikuo
Oh, forgot mention: you need to save an orignal copy somewhere before you modify it, just in case.
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.