Customizing Your SAS Session by Using System Options

Ways to Customize Your SAS Session

You can customize your SAS environment in several ways. One way is through the use of SAS system options. For information about other ways to customize a SAS session, see Overview of Customizing SAS in X Environment.

Ways to Specify a SAS System Option

SAS options can be specified in one or more ways:
  • in a configuration file
  • in the SASV9_OPTIONS environment variable
  • in the SAS command
  • in an OPTIONS statement (either in a SAS program or an autoexec file) (An autoexec file contains SAS statements that are executed automatically when SAS is invoked. The autoexec file can be used to specify some SAS system options, as well as to assign librefs and filerefs to data sources that are used frequently.)
  • in the System Options window
See Summary of All SAS System Options in UNIX Environments to view where each SAS system option can be specified.
Any options that do not affect the initialization of SAS, such as CENTER and NOCENTER, can be specified and changed at any time.
Some options can be specified only in a configuration file, in the SASV9_OPTIONS variable, or in the SAS command. These options determine how SAS initializes its interfaces with the operating system and the hardware; they are often called configuration options. After you start a SAS session, these options cannot be changed. Usually, configuration files specify options that you would not change very often. In those cases when you need to change an option just for one job, specify the change in the SAS command.

Overriding the Default Value for a System Option

The default values for SAS system options will be appropriate for many of your SAS programs. However, you can override a default setting using one or more of the following methods:
configuration file
Modify your current configuration file (see Order of Precedence for Processing SAS Configuration Files) or create a new configuration file. Specify SAS system options in the file by preceding each with a hyphen. For ON or OFF options, just list the keyword corresponding to the appropriate setting. For options that accept values, list the keyword identifying the option followed by the option value. All SAS system options can appear in a configuration file.
For example, a configuration file might contain these option specifications:
-nocenter
-verbose
-linesize 64
SASV9_OPTIONS environment variable
Specify SAS system options in the SASV9_OPTIONS environment variable before you invoke SAS. See Defining Environment Variables in UNIX Environments.
Settings that you specify in the SASV9_OPTIONS environment variable affect SAS sessions that are started when the variable is defined.
For example, in the Korn shell, you would use:
export SASV9_OPTIONS='-fullstimer -nodate'
SAS command
Specify SAS system options in the SAS command. Precede each option with a hyphen:
sas -option1 -option2...
For ON or OFF options, list the keyword corresponding to the appropriate setting. For options that accept values, list the keyword that identifies the option, followed by the option value. For example,
sas -nodate -work mywork
Settings that you specify in the SAS command last for the duration of the SAS session or, for those options that can be changed within the session, until you change them. All options can be specified in the SAS command.
OPTIONS statement within a SAS session
Specify SAS system options in an OPTIONS statement at any point within a SAS session. The options are set for the duration of the SAS session or until you change them. When you specify an option in the OPTIONS statement, do not precede its name with a hyphen (-). If the option has an argument, use = after the option name.
For example,
options nodate linesize=72;
options editcmd='/usr/bin/xterm -e vi';
For more information about the OPTIONS statement, see OPTIONS Statement in SAS Statements: Reference. Not all options can be specified in the OPTIONS statement. To find out about a specific option, look up its name in Summary of All SAS System Options in UNIX Environments.
OPTIONS statement in an autoexec file
Specify SAS system options in an OPTIONS statement in an autoexec file. An autoexec file contains SAS statements that are executed automatically when SAS is invoked. The autoexec file can be used to specify some SAS system options, as well as to assign librefs and filerefs to data sources that are used frequently. For example, your autoexec file could contain the following statements:
options nodate pagesize=80; 
filename rpt '/users/myid/data/report';
System Options window
Change the SAS system options from within the System Options window.
In general, use quotation marks to enclose filenames and pathnames specified in the OPTIONS statement or the System Options window. Do not use quotation marks otherwise. Any exceptions are discussed under the individual option. To shorten filenames and pathnames that you specify, you can use the abbreviations listed in Character Substitutions in Pathnames.

How SAS Processes System Options Set in One Place

If the same option is set more than once within the SAS command, a configuration file, or the SASV9_OPTIONS environment variable, only the last setting is used; the others are ignored. For example, the DMS option is ignored in the following SAS command:
sas -dms -nodms
The DMS option is also ignored in the following configuration file:
-dms
-linesize 80
-nodms
By default, if you specify the HELPLOC, MAPS, MSG, SAMPLOC, SASAUTOS, or SASHELP system options more than one time, the last value that is specified is the value that SAS uses. If you want to add additional pathnames to the pathnames already specified by one of these options, you must use the APPEND or INSERT system options. For more information, see the APPEND System Option: UNIX and INSERT System Option: UNIX.

How SAS Processes System Options Set in Multiple Places

System Options Set in Multiple Places

When the same option is set in more than one place, the most recent specification is used. The following places are listed in order of precedence. For example, a setting made in the System Options window or OPTIONS statement will override any other setting. However, if you set a system option using the SASV9_OPTIONS environment variable, then this option will override only the setting for the same system option in your configuration file.

Order of Precedence for Processing System Options

The precedence for processing system options is as follows:
  1. System Options window or OPTIONS statement (from a SAS session or job).
  2. autoexec file that contains an OPTIONS statement (after SAS initializes). (An autoexec file contains SAS statements that are executed automatically when SAS is invoked. The autoexec file can be used to specify some SAS system options, as well as to assign librefs and filerefs to data sources that are used frequently.)
  3. SAS command.
  4. SASV9_OPTIONS environment variable.
  5. configuration files (before SAS initializes). For more information, see Order of Precedence for Processing SAS Configuration Files.
For example, if a configuration file specifies NOSTIMER, you can override the setting in the SAS command by specifying –FULLSTIMER.
By default, if you specify the HELPLOC, MAPS, MSG, SAMPLOC, SASAUTOS, or SASHELP system option more than one time, the last value that is specified is the value that SAS uses. If you want to add additional pathnames to the pathnames already specified by one of these options, you must use the APPEND or INSERT system options to add the new pathname. For more information, see the APPEND System Option: UNIX and INSERT System Option: UNIX.