Getting Started with SAS in UNIX Environments |
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 Customizing the SAS Windowing Environment.
Ways to Specify a SAS System Option |
SAS options can be specified in one or more ways:
Summary of All SAS System Options shows 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:
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/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
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'
Specify SAS system options in the SAS command. Precede each option with a hyphen:
sas -option1 -option2...
For ON/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.
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.
options nodate linesize=72; options editcmd='/usr/bin/xterm -e vi';
Refer to SAS Language Reference: Dictionary for more information about the OPTIONS statement. Not all options can be specified in the OPTIONS statement. To find out about a specific option, look up its name in SAS System Options under UNIX.
Specify SAS system options in an OPTIONS statement in an autoexec file. For example, your autoexec file could contain the following statements:
options nodate pagesize=80; filename rpt '/users/myid/data/report';
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. You can use the abbreviations listed in Character Substitutions in Pathnames to shorten the filenames and pathnames you specify.
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 APPEND System Option: UNIX and INSERT System Option: UNIX.
How SAS Processes 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, but 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.
The precedence for processing system options is as follows:
System Options window or OPTIONS statement (from a SAS session or job).
autoexec file that contains an OPTIONS statement (after SAS initializes).
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. See APPEND System Option: UNIX and INSERT System Option: UNIX for more information.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.