DATA Step, Macro, Functions and more

Default Directory when Opening SAS program

Reply
Regular Contributor
Posts: 171

Default Directory when Opening SAS program

When you open a SAS program (File -> Open Program...), by default, you start looking for the program in the Sasuser directory. Is there a way to change the default behavior by specifying an alternate folder to begin the search?

Thanks!
Regular Contributor
Posts: 171

Re: Default Directory when Opening SAS program

Never mind, I figured it out by modifying the config file. Thanks again.
Super Contributor
Posts: 673

Re: Default Directory when Opening SAS program

How is it done?
Regular Contributor
Posts: 171

Re: Default Directory when Opening SAS program

Enter the following statement at the top of the config file, substituting for the desired directory:

- SASINITIALFOLDER = 'directory'
Super Contributor
Posts: 292

Re: Default Directory when Opening SAS program

Another way to do this is to add some syntax to the target line in the short cut used to call up SAS (assuming a PC environment). If it's done here, all users can still have the same config file and you don't lose your personal settings in the case of an update or refresh.

"C:\Program Files\SAS\SAS 9.1\sas.exe" -CONFIG "F:\BusinessResults\QSRptsys\Programs\SAS_Other\SASV9.CFG" -set sasfolder "F:\BusinessResults\QSRptsys\Programs" -sasInitialFolder "f:\BusinessResults\QSRptsys\"
Valued Guide
Posts: 2,177

Re: Default Directory when Opening SAS program

> Another way to do this is to add some syntax to the
> target line in the short cut used to call up SAS
> (assuming a PC environment). If it's done here, all
> users can still have the same config file and you
> don't lose your personal settings in the case of an
> update or refresh.
>
> "C:\Program Files\SAS\SAS 9.1\sas.exe" -CONFIG
> "F:\BusinessResults\QSRptsys\Programs\SAS_Other\SASV9.
> CFG" -set sasfolder
> "F:\BusinessResults\QSRptsys\Programs"
> -sasInitialFolder "f:\BusinessResults\QSRptsys\"

I think the complexity and length of the demonstration command line shows why and how a config file can help.
Typically I just create my config file overrides file (sasv9.cfg) in the folder where I launch my programs.

When I have control of the start-up command, I remove any -config parameters. Then SAS uses a complex technique to retrieve config files named sasv9.cfg from the folders
1 install folder which holds sas.exe
2 my home folder ( the "my documents" folder on windows )
3 "current folder"

I recommend placing
application specific option settings in the "current folder",
personal preferences (like awstitle) in the "home folder"

There are other places from which SAS will retrieve start-up options and when I can't change the SAS start command, I use any of the alternatives - preference is to set the op.sys system environment (user) variable %sas_options% to
-verbose -config "my_path\my_sasv9.cfg" -config '.\sasv9.cfg'
(-verbose reveals a lot of setup information)

"How SAS Finds and Processes Configuration Files" is documented at http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#a000104286.htm#sea...

peterC
Ask a Question
Discussion stats
  • 5 replies
  • 155 views
  • 0 likes
  • 4 in conversation