Customizing Your SAS Session using System Options


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 Chapter 3, "Customizing the SAS Windowing Environment," on page 53.

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)

  • in the System Options window.

Table 17.3 on page 385 shows where each SAS system option can be specified.

Any options that do not affect the initialization of the 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 SAS Configuration Files" on page 17) 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 

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" on page 21.

    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='-xwait -nodate' 

SAS command

  • 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.

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'; 

    Refer to SAS Language Reference: Dictionary for more information on 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 Table 17.3 on page 385.

OPTIONS statement in an autoexec file

  • Specify SAS system options in an OPTIONS statement in a autoexec file. 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. You can use the abbreviations listed in Table 4.6 on page 115 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. See "APPEND System Option" on page 315 and "INSERT System Option" on page 337 for more information.

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 will override only the setting for the same system option in your configuration file.

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)

  3. SAS command

  4. SASV9_OPTIONS environment variable

  5. configuration files (before SAS initializes). For more information, see "Order of Precedence for SAS Configuration Files" on page 17.

For example, if a configuration file specifies NOSTIMER, you can override the setting in the SAS command.

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" on page 315 and "INSERT System Option" on page 337 for more information.




SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net