DATA Step, Macro, Functions and more

Assigning folder containing data sets in SASUSER

Reply
Contributor
Posts: 44

Assigning folder containing data sets in SASUSER

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';

 

 

Super User
Super User
Posts: 7,407

Re: Assigning folder containing data sets in SASUSER

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.

Super User
Posts: 6,946

Re: Assigning folder containing data sets in SASUSER

A library cannot contain another library. Libraries only contain members (datasets, views, catalogs).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,124

Re: Assigning folder containing data sets in SASUSER

[ Edited ]

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.

Ask a Question
Discussion stats
  • 3 replies
  • 270 views
  • 1 like
  • 4 in conversation