| SAS Companion for the Microsoft Windows Environment |
The SAS System uses many files while it is running; however, some of these files are especially important
from a user's perspective. These files include the
The SAS configuration file enables you to specify SAS system options that are used to establish your SAS session. These system options
indicate, among other things, the location of your SAS System help and message files and the paths to SAS executable files. The SAS configuration file is particularly important because it
specifies the directories that are searched for the various components of SAS products. You must have at least one configuration file in order for the SAS System to initialize; you can have multiple
configuration files that are all processed while your SAS session begins. For a list of system options you can use in your SAS configuration file, see
Summary of System Options for Windows. For more information about system options, see the section on SAS system options in this
document and in SAS Language Reference: Dictionary.
A default SAS configuration file named SASV7.CFG is created during the installation process and is stored in the !SASROOT directory. (The
!SASROOT directory is the directory in which you install the SAS System. For more information on the !SASROOT directory, see SAS Default Directory Structure.)
The SAS System
requires a configuration file, so you must use a SAS configuration file regardless of whether you are using display manager or batch mode.
You can specify any SAS system option in the SAS command when you start the SAS System. However, it is generally more convenient to place frequently used system options in
your SAS configuration file rather than repeatedly specifying the same options at invocation. The syntax for specifying system options in the SAS configuration file is discussed in
Syntax for System Options in the SAS Invocation or SAS Configuration File.
You can edit the default configuration file to add to or change the system option settings, or
you can create your own SAS configuration file. Naming Conventions for the SAS Configuration File discusses how to modify your SAS configuration
file.
Your SAS configuration file is divided into two sections. The first section specifies system options that are not updated by the SAS System Setup application. The
second section is used by the SAS System Setup application for updating information about where SAS software is installed. The sections are divided by the following text string:
/* DO NOT EDIT BELOW THIS LINE - INSTALL */
/* application edits below this line */
The SAS System Setup application deletes all data below this text string but does not affect the options specified above it. The Setup application appends the following
system options below this text string: MAPS, PATH, PATHDLL, SASAUTOS, SASHELP, SASMSG, and SET. (The SET system option defines the following SAS environment variables: SASFOLDER, SASROOT, INSTALL,
LIBRARY, SAMPSIO, SAMPSRC, SASCBT, SASEXT01--SASEXT50, and USAGE).
- CAUTION:
- Use the SAS text editor to edit your configuration
file.
The text editor you choose to edit the SAS configuration file is important to
preserve some of the special character formatting in the file. The recommended method is to edit your configuration file using the SAS text editor (such as the Program Editor window) and save it using
the Save As dialog box. If you do not use the
SAS text editor, be sure to use another ASCII text editor (such as Windows Notepad). Do not use a specialized editor such as the WordPad application that comes with Windows. Using such an editor can
insert carriage control characters into your configuration file or corrupt the characters that are there.
![[cautend]](../common/images/cautend.gif)
When you install the SAS System under Windows, a SASV7.CFG file is created in the !SASROOT directory.
You can specify your own file to act as the
SAS configuration file, overriding the default file, SASV7.CFG. When you use a file located in a different place or under a different name as your default SAS configuration file, you must tell the SAS
System where to find the configuration file. For example, the Target field of the SAS System properties might contain:
C:\SAS\SAS.EXE -CONFIG C:\SAS\MySASConfig.CFG
If the SAS System cannot find the SAS configuration file, an error message is displayed, and the SAS System does not initialize.
- CAUTION:
- You must add
several required system options if you create your SAS configuration file from scratch.
If you use your own configuration file instead of the default configuration file, you must add several required options. For example, you must either use the SET option to
define the environment variable, !SASROOT, or define SASROOT as a Windows environment variable.
Therefore, if you do not want to use the default configuration file, you should copy the default file (SASV7.CFG) and modify the copy instead of creating your own file from
scratch.
![[cautend]](../common/images/cautend.gif)
When you invoke the SAS System, SAS automatically searches several locations for
configuration options that can affect your SAS session. SAS looks in the following areas and processes them in this order:
-
SAS_SYS_CONFIG operation system
environment variable
-
This environment variable, if defined, must resolve to a valid SAS configuration file. On a multi-user Windows NT system, this environment variable would most likely
be defined as a system environment variable (instead of as a user environment variable) so that it is processed for all users on that system. Use the SAS_USER_CONFIG user environment variable to
specify a user-specific configuration file.
-
files specified by CONFIG system options
-
On the SAS invocation command, you can specify one or more -CONFIG options with the names of the configuration files that you want to use. You must include a separate
-CONFIG option for each file that you want to specify.
-
SASV7.CFG in the current directory
-
SAS looks for a file that is named SASV7.CFG in the current directory only if you do not specify a -CONFIG option on the SAS
invocation.
-
SASV7.CFG in the directory where SAS.EXE resides
-
SAS looks for a file that is named SASV7.CFG in the directory that contains the SAS.EXE executable only if you do not specify a -CONFIG option on the SAS
invocation and there is no SASV7.CFG file in the current directory.
-
SAS_USER_CONFIG operating system environment variable
-
This environment variable, if defined, must resolve to a valid SAS configuration file. On a multi-user Windows NT system, this environment variable would likely be
defined as a user environment variable (instead of as a system environment variable) so that it is processed only for the current user on that system. Use the SAS_SYS_CONFIG system environment
variable to specify a system-wide configuration file.
-
SAS_OPTIONS operating system environment variable
-
This environment variable, if defined, contains a string of option specifications for any other SAS System options that you want to process each time that you invoke
the SAS System.
-
SAS invocation command line
-
You can specify additional system options on the command that you use to invoke the SAS System. These system options always override option values that are set within
any of the configuration files.
You can also specify additional --CONFIG options within any of the above configuration files. When the SAS System encounters a
--CONFIG option, SAS immediately processes the options in that named file and then returns to process the remainder of the current file. SAS System options that are encountered later in the
processing always override those options that are specified earlier. For example, if you specify --ICON in the file specified by the SAS_SYS_CONFIG environment variable,
and then --NOICON in the file specified by the SAS_USER_CONFIG environment variable, the --NOICON option is used. Since the options that you specify on
the SAS invocation command are always processed last, those option values will always override the option values specified in configuration files.
Order of Processing for SAS Configuration Files illustrates the flow of SAS System configuration file processing.
For more information about the
CONFIG system option, see CONFIG.
Order of Processing for SAS Configuration Files
The SAS autoexec file contains SAS statements that are executed immediately after the SAS System initializes and before any user input is
accepted. These SAS statements can be used to invoke SAS programs automatically, set up certain variables for use during your SAS session, or set system options. Unlike the SAS configuration file,
a SAS autoexec file is not required in order to run the SAS System, but if you do have a SAS autoexec file, the default name is AUTOEXEC.SAS. During initialization of your SAS session, the SAS System
searches the current directory for the AUTOEXEC.SAS file; if it is not present and if you did not specify the -AUTOEXEC option on the command line or within any of your configuration files, then the
SAS System assumes that there is no AUTOEXEC file to process. For more information about the AUTOEXEC system option,
see AUTOEXEC.
You
do not have to name your SAS autoexec file AUTOEXEC.SAS, but if you name it something else, you must use the AUTOEXEC system option to tell the SAS System where to find the SAS autoexec file. For
example, you can specify the following option after the path specification for the SAS.EXE file in the Target field of the SAS System Windows shortcut:
-AUTOEXEC C:\MySASFiles\INIT.SAS
If the specified SAS autoexec file is not found, an error message is displayed, and the SAS System terminates.
The SAS autoexec file is a convenient way to execute a
standard set of SAS program statements each time you invoke the SAS System. You may want to include OPTIONS, LIBNAME or FILENAME statements, or any other SAS statements and system options you want the
system to execute each time you invoke a SAS session. For example, if you want to specify a script file for SAS/CONNECT software, you can place the following
statement in the AUTOEXEC.SAS file:
filename rlink 'c:\sas\connect\saslink\vms.scr';
Or you can use the OPTIONS statement to set the page size and line size for your SAS System output and use several FILENAME statements to set up filerefs for
commonly-accessed network drives, as in the following example:
options linesize=80 pagesize=60;
filename saledata 'f:\qtr1';
filename custdata 'l:\newcust';
filename invoice 'o:\billing';
- CAUTION:
- Use the SAS text editor to create your SAS autoexec file.
The text
editor you choose to create the SAS autoexec file is important. The recommended method is to create it using the SAS text editor (such as the Program Editor window) and save it using the Save As
dialog box. If you do not use the SAS text editor, be sure to use another ASCII text editor (such as Windows Notepad). Do not
use a specialized editor such as the Wordpad application that comes with Windows. Using such an editor can insert special carriage control characters into your SAS autoexec file that the SAS System
cannot interpret when it tries to execute the statements in the file.
![[cautend]](../common/images/cautend.gif)
Other system options, in addition to the AUTOEXEC system option, provide ways to send the
SAS System information as it is starting up. These options are listed below in the order in which they are processed:
-
CONFIG (at SAS System invocation
only)
-
AUTOEXEC
-
INITCMD
-
INITSTMT
-
SYSIN
For
more information about the CONFIG, AUTOEXEC, and SYSIN system options, see SAS System Options under Windows. For more information about the INITCMD and
INITSTMT system options, see SAS Language Reference: Dictionary.
If you have an
AUTOEXEC.SAS file in your current directory but do not want the SAS System to use it, specify the NOAUTOEXEC option in the SAS command, as in the following example:
C:\SAS\SAS.EXE -NOAUTOEXEC
Each time you invoke a SAS session, the SAS System checks the SASUSER data library for your user profile catalog (named SASUSER.PROFILE), which
defines the start-up profile for your SAS session, including key definitions, display configurations, and so on. If you invoke the SAS System without accessing an existing profile catalog,
SAS creates one with the default key definitions and window configuration.
Use the SASUSER system option to specify a location for the profile catalog other than the
default (which is a directory named SASUSER). This option is useful if you want to customize your SAS sessions when sharing a machine with other users or if users are accessing the SAS System from a
network.
The SASUSER system option takes the following form:
|
-SASUSER
("library-specification")
|
Note:
Parentheses () are use to specify multiple library-specifications, and
quotes (") are used when special characters are used in the library-specification. ![[cautend]](../common/images/cautend.gif)
If library-specification
(which specifies a valid Windows pathname) does not exist, the SAS System attempts to create it. For example, if you specify the following option, a profile catalog is created in a directory named
MYUSER that resides in the root directory of the C: drive:
-sasuser c:\myuser
Note:
The default configuration file for the SAS System specifies the SASUSER system option as follows:
-sasuser !sasfolder\sasuser\
where !sasfolder is set to the same location as the SAS System program files. ![[cautend]](../common/images/cautend.gif)
The profile catalog is not recreated if it already exists.
Any customizations (such as key definitions or color modifications) defined during subsequent sessions are stored in your profile catalog in the specified directory.
When
you delete your profile catalog, you lose the key definitions, window configurations, and option settings that you might have defined, as well as any other entries that you saved to your profile
catalog. In addition, any text that you stored in NOTEPAD windows is erased. For this reason, it is a good idea to make a backup copy of your profile catalog after making significant modifications to
your SAS session settings.
For more information about the SASUSER system option, see
SASUSER.
The SAS System requires some temporary disk space
during a SAS session. This temporary disk space is called the WORK data library. By default, the SAS System stores SAS files with one-level names in the WORK data library, and
these files are deleted when you end your SAS session. You can change the data library in which SAS files with one-level names are stored. For more information, see
Using the USER Libref
The WORK system option controls the location of the WORK data library. You can specify the WORK
option in your SAS configuration file or when you invoke the SAS System. Usually, you use the WORK option specified in the default configuration file.
The default
configuration file for the SAS System specifies the WORK system option to be a directory in your system's designated temporary area (as defined by the TEMP environment variable). For example
-work "C:\TEMP\SAS Temporary Files"
Because you can run multiple SAS sessions at one time, the SAS System creates temporary subdirectories under the directory you specify with the WORK option. These
temporary subdirectories are created in the unique form #TDnnnnn, where TD means temporary directory and nnnnn is the process ID for each SAS
session. These subdirectories enable multiple SAS sessions to be invoked using the same configuration file, and they prevent the
WORK directory from being shared. The SAS System creates any temporary files required within each temporary directory. As with all temporary files that are created in the WORK data library during a
SAS session, these temporary directories are deleted when you end the SAS session. However, if for some reason the SAS session ends abnormally, these temporary files are not
deleted.
If you do not want the SAS System to create a temporary subdirectory under the specified WORK directory, but would rather use the actual directory specified in the
WORK system option, specify the USE suboption in the WORK option. For example, you can specify the following in the Target field of the SAS System properties:
-work "C:\TEMP\SAS Temporary Files" use
This creates a directory called "C:\TEMP\SAS Temporary Files" and all temporary SAS files are stored in this directory, not in a
subdirectory.
For more information about using the WORK data library and overriding the default location, see
Using the WORK Data Library.
If the SAS System terminates abnormally, determine if the WORK library was deleted. If not,
remove it by using Windows commands.
Note:
Do not attempt to delete the WORK directory while the SAS System is running. ![[cautend]](../common/images/cautend.gif)
If you want to
verify the location of the current WORK directory, click the right mouse button on the WORK library item in the SAS Explorer window and select Properties from the pop-up
menu.
The SAS registry files are used to store information about the SAS session applications. The registry entries can be customized using the SAS registry editor or by importing the registry files. To
invoke the SAS registry editor, use the Solutions menu and select Accessories and Registry
Editor.
- CAUTION:
- For Experienced Users Only.
Registry customization is generally performed by more advanced users with experience and
knowledge of the SAS System and their operating environment.
![[cautend]](../common/images/cautend.gif)
The SAS System Setup program
creates a number of subdirectories during the installation process. Understanding the organization of the SAS directories can help you to use the SAS System more efficiently. The SAS System can be
installed on a single drive or across multiple drives. It is not recommended that a single product of the SAS System be split over multiple drives.
The root directory of
the SAS System is the directory in which you install the SAS System. Within SAS, this directory has the logical name !SASROOT. In many installations, the real physical name of this directory is
SAS, but this is not required. (The examples in this document assume the !SASROOT directory is called SAS.)
One important subdirectory of the !SASROOT directory is the CORE
subdirectory. The CORE subdirectory in turn contains many subdirectories, three of which are described here:
-
!SASROOT\CORE\HELP
-
contains the SAS help information in HTML Help format.
-
!SASROOT\CORE\RESOURCE
-
contains SAS resources such as fonts and images.
-
!SASROOT\CORE\SASINST
-
contains the installation process software.
For each SAS product installed, the following
subdirectories might be created (but not all products contain all of these directories):
-
!SASROOT\product\SASEXE
-
contains the SAS executable files.
-
!SASROOT\product\SASHELP
-
contains many specialized catalogs and files.
-
!SASROOT\product\SASMACRO
-
contains SAS autocall macro files.
-
!SASROOT\product\SASMSG
-
contains the SAS message files.
-
!SASROOT\product\SAMPLE
-
contains the Sample Library programs.
-
!SASROOT\product\SASTEST
-
contains Test Stream programs.
-
!SASROOT\product\SASMISC
-
contains miscellaneous external files shipped with the product.
Some products, such as
SAS/CONNECT software, also have other subdirectories associated with them. For details about each product's structure, see the specific SAS product
documentation.
For more information about how the SAS directories are configured at your site, contact your SAS Support Consultant.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.