Help using Base SAS procedures

change defualt folder

Super Contributor
Posts: 271

change defualt folder

hello everyone,

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

data ONE;



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.


Super User
Super User
Posts: 8,093

Re: change defualt folder

Posted in reply to GeorgeSAS

Look at the USER option and/or USER libname.

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: 13,528

Re: change defualt folder

Posted in reply to GeorgeSAS

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.

Trusted Advisor
Posts: 3,215

Re: change defualt folder

Posted in reply to GeorgeSAS

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
  • 1 like
  • 4 in conversation