To find the AUTOEXEC.SAS file, SAS searches the following, in this order:
If an AUTOEXEC.SAS file is not present in any of these folders, and if you did not specify the -AUTOEXEC option on the command line or within any of your configuration files, then SAS assumes
that there is no autoexec file to process, even if one resides on your hard drive.
At start-up, the SAS log displays the full pathname of the AUTOEXEC file processed.
The Current Folder
The current folder is displayed in the status bar at the bottom of the main SAS window. If the SASINITIALFOLDER option is not used, then the current folder displayed on the status bar is where SAS
searches for the AUTOEXEC file first. The path specified by the SASINITIALFOLDER option is not searched for the autoexec.sas file. (Note: See the section "The SASINITIALFOLDER Option," below, to determine whether the SASINITIALFOLDER option is set.)
The current folder is determined according to the following rules:
- If you use a program item or shortcut to start SAS and a path is specified in the Windows Properties Shortcut tab (Start in field), SAS uses that path as the current folder.
- If you use a command to start SAS by using either the Run dialog box or a command line and the command contains a path to SAS.EXE, the current folder is the path that you specify as part of the SAS command, regardless of where Windows actually finds the SAS.EXE file.
- If you use a command to start SAS and you do not specify a path as part of the SAS command, then the current folder is the path from which you issued the command.
If Windows cannot find the SAS.EXE file in the specified folder, the folder that is specified in the SAS command still becomes the current folder and Windows searches for the SAS.EXE file by using
the Windows PATH environment variable.
For example, if you specify the command shown below, the current folder is C:\MYSAS, regardless of whether the SAS.EXE file is actually in that folder:
c:\mysas\sas.exe -config c:\mysas\sasv9.cfg
- If you start SAS by double-clicking a .SAS program file from
Windows Explorer, the default current folder is the path to the
operating system with \system32 appended to it. An example of a default current folder under Windows NT and Windows XP is C:\winnt\system32.
The SASINITIALFOLDER Option
To determine whether the SASINITIALFOLDER option is set, submit the following SAS code:
PROC OPTIONS OPTION=SASINITIALFOLDER;
RUN;
Check the SAS log for the results. The SASINITIALFOLDER option is not set if the log shows this:
SASINITIALFOLDER= Sets SAS's initial working folder.
If the SAS log shows that the SASINITIALFOLDER option is set to a specific location, then to determine the current folder where SAS searches, remove the SASINITIALFOLDER option and restart SAS. Then, the current folder displayed on the status bar without the SASINITIALFOLDER option is the first directory searched for the AUTOEXEC file.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows XP Professional | 8.2 TS2M0 | |
Microsoft Windows NT Workstation | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows 95/98 | 8.2 TS2M0 | |
Microsoft Windows 2000 Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Professional | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.