SAS Language Reference: Dictionary |
Operating Environment Information:
SAS system options
are initialized with default settings when SAS is invoked. However, the default
settings for some SAS system options vary both by operating environment and
by site. For details, see the SAS documentation for your operating environment.
|
Determining Which Settings Are in Effect |
To
determine which settings are in effect for SAS system options,
use one of the following:
- OPLIST system option
- Writes to the SAS log the settings in system
and user configuration files that were set when SAS was invoked. (See the
SAS documentation for your operating environment for more information.)
- SAS System Options window
- Lists all system option settings.
- OPTIONS procedure
- Writes system option settings to the SAS
log. To display the settings of system options with a specific functionality,
such error handling, use the GROUP= option:
proc options GROUP=errorhandling;
run;
(See the
SAS Procedures Guide for more information.)
- GETOPTION function
- Returns the value of a specified system
option.
- VOPTION Dictionary table
- Located in the SASHELP library, VOPTION
contains a list of all current system option settings. You can view this
table with SAS Explorer, or you can extract information from the VOPTION table
using PROC SQL.
- dictionary.options SQL table
- Accessed with the SQL procedure, this table lists the system
options that are in effect.
|
Changing SAS System Option Settings |
At invocation, SAS
provides default settings for SAS system
options. There are several ways to override the default settings. Depending
on the function of the system option, you can specify a setting
- on the command line: You can specify
any SAS system option setting either on the command line or in a configuration
file. Either method sets your SAS system options during SAS invocation. Many
SAS system option settings can be specified only during SAS invocation. Descriptions
of the individual options provide details.
- in a configuration file: If you use
the same option settings frequently, it is usually more convenient to specify
the options in a configuration file, rather than on the command line.
- in an OPTIONS statement: You can
specify an OPTIONS statement at any time during a session except within data
lines or parmcard lines. Settings remain in effect throughout the current
program or process unless you reset them with another OPTIONS statement or
change them in the SAS System Options window. You can also place an OPTIONS
statement in an autoexec file.
- in a SAS System Options window: If
you are in a windowing environment, type
options
in the toolbox to open the SAS System Options window. The SAS System Options
window lists the names of the SAS system options and allows you to change
their current settings. Changes take effect immediately and remain in effect
throughout the session unless you reset them with an OPTIONS statement or
change them in the SAS System Options
window.
|
How Long System Option Settings Are in Effect |
When
you specify a SAS system option setting within a DATA or
PROC step, the setting applies to that step and to all subsequent steps for the duration of the SAS session or until you reset, as shown:
data one;
set items;
run;
/* option applies to all subsequent steps */
options obs=5;
/* printing ends with the fifth observation */
proc print data=one;
run;
/* the SET statement stops reading
after the fifth observation */
data two;
set items;
run;
To read more than five observations, you must reset
the OBS= system option. For more information, see
OBS=.
If the same system option
appears in more than one place, the
order of precedence from highest to lowest is
- OPTIONS statement and SAS System Options window
- autoexec file
(that contains an OPTIONS statement)
- command-line specification
- configuration file
specification
- SAS system default settings.
Operating Environment Information: In
some operating environments, you can specify system options in other places.
See the SAS documentation for your operating environment.
Order of Precedence for SAS Execution Mode Options
shows the order of precedence that SAS uses for execution mode options. These
options are a subset of the SAS invocation options and are specified on the
command line during SAS invocation.
The order of precedence of SAS execution mode options consists
of the following rules:
- SAS uses the execution mode option with the highest precedence.
- If you specify more than one execution mode option of equal
precedence,
SAS uses only the last option listed.
See the descriptions of the individual options for more details.
|
Interaction with Data Set Options |
Many system options and data set options share the same name
and have the same function. System options remain in effect for all DATA and
PROC steps in a SAS job or session unless they are respecified. The data set
option, however, overrides the system option only for the step in which it
appears.
In this example, the OBS= system option in the OPTIONS
statement specifies that only the first 100 observations will be read from
any data set within the SAS job. The OBS= data set option in the SET statement,
however, overrrides the system option and specifies that only the first 5
observations will be read from data set TWO. The PROC PRINT step uses the
system option setting and reads and prints the first 100 observations from
data set THREE:
options obs=100;
data one;
set two(obs=5);
run;
proc print data=three;
run;
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.