Help using Base SAS procedures

change defualt folder

Reply
Regular Contributor
Posts: 209

change defualt folder

hello everyone,

Our SAS use work folder as default, if we create a data set such as :

data ONE;

x=1;

run;

then the one data set will be created in WORK folder.

My question is if I have another folder named mylib(libname mylib "c:\myfolder1"Smiley Wink, Is there any SAS code that I can do to make this folder to default  folder as WORK? and if it works ,when I create the data set named ONE use the code above it will be created in mylib folder by default.

Thanks

Super User
Super User
Posts: 6,502

Re: change defualt folder

Look at the USER option and/or USER libname.

http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/viewer.htm#userlib.htm

Note that if you do this you can still reference tables in the WORK folder by using a two level name. (WORK.ONE)

Super User
Posts: 10,538

Re: change defualt folder

Some warnings about using a USER library:

1) USER libraries persist from session to session, which may or may not be a good thing depending on how you work.

2) It is your responsibility to clean it up. You can end up with thousands of datasets which for some operations might impact performance, especially opening the library in the SAS Explorer.

3) If you reuse dataset names you will overwrite existing datasets of the same name. So be very conscious of which datasets are pretty temporary and you don't care if they get replaced and those that you intend to keep. Actually if you intend to keep them for any period of time you should consider other permanent libraries.

Valued Guide
Posts: 3,208

Re: change defualt folder

The user librarie is often locasted at \sashome or "my docuements" often having space limitations and being managed by others. They should only be used by exception not as default.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 3 replies
  • 243 views
  • 1 like
  • 4 in conversation