| SAS Companion for UNIX Environments |
You can customize your SAS session by defining configuration
and/or autoexec files. You can use these files to specify system options and
to execute SAS statements automatically whenever you start a SAS session.
(SAS system options control many aspects of your SAS session, including output
destinations, the efficiency of program execution, and the attributes of SAS
files and data libraries. Refer to
SAS Language Reference: Dictionary for a complete description of system
options.)
The differences between configuration files and autoexec
files are
The configuration file (for Version 7) is typically named
sasv7.cfg, and the autoexec file is named
autoexec.sas. These files typically
reside in your home directory.
SAS system 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
the SAS System, 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 SASV7_OPTIONS
variable, or in the SAS command. These options determine how the SAS System
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 option 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.
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
Processing 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. For example, a configuration
file might contain these option specifications:
-nocenter
-verbose
-linesize 64
All SAS system options can appear in a configuration file.
-
Specify SAS system options in the SASV7_OPTIONS
environment variable before you invoke the SAS System. See Defining Environment Variables. For example, in the Korn shell,
you would use:
export SASV7_OPTIONS='-xwait -nodate'
Settings that you specify in the SASV7_OPTIONS environment
variable affect SAS sessions that are started when the variable is defined.
-
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. 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 Summary of All SAS System Options.
-
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';
-
Change the SAS system options from within the
System Options window.
In general, use quotes to enclose filenames and pathnames
specified in the OPTIONS statement or the System Options window. Do not use
quotes 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.
If the same option is set more than once within the SAS command,
only the last setting is used; the others are ignored. For example, the DMS
option is ignored in this case:
sas -dms -nodms
However,
if the same option is set more than once within a configuration file, or within
the SASV7_OPTIONS environment variable, only the first setting is used; the
others are ignored. For example, the NODMS option is ignored in the following
case:
-dms
-linesize 80
-nodms
By default, if you specify the CONFIG, ECHO, HELPLOC, MAPS, MSG, SAMPLOC,
SASAUTOS, SASHELP, FSIMMOPT, MSG, and SASSCRIPT 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 to add
the new pathname. See APPEND
and INSERT
for more information.
When the same option is set in more than one place, the most
recent specification is used. In the following list, settings in places listed
first override settings in places listed farther down:
-
System Options window or OPTIONS statement (from
a SAS session or job).
-
autoexec file that contains an OPTIONS statement
(after the SAS System initializes)
-
SAS command
-
SASV7_OPTIONS environment
variable
-
configuration files (before the SAS System initializes)
For example, if a configuration file specifies NOSTIMER, you
can override the setting in the SAS command.
By default, if you specify the CONFIG, ECHO, HELPLOC, MAPS, MSG, SAMPLOC,
SASAUTOS, SASHELP, FSIMMOPT, MSG, and SASSCRIPT 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
and INSERT
for more information.
The SAS System is shipped with a default configuration file
in the
sasroot directory.
Your SAS Installation Representative can edit this configuration file so that
it contains whichever options are appropriate to your site.
You can also create one or more of your own configuration files.
SAS reads the option settings from each of these files in this order:(footnote 1)
-
sasv7.cfg in your current
directory.
-
sasv7.cfg in your home directory.
-
.sasv7.cfg in your home directory.
(Notice the leading period.)
-
sasv7.cfg in the
sasroot directory. (See The sasroot Directory.)
You can bypass this search by:
filename is the name of a file containing SAS
system options.
If you have specified a configuration file in the SASV7_OPTIONS
or SASV7_CONFIG environment variables, you can prevent the SAS System from
using that file by specifying NOCONFIG in the SAS command.
To create a configuration file, you can copy
sasv7.cfg from the
sasroot
directory and modify it to set the options you want.
FOOTNOTE 1:
For future versions of SAS, the extensions
of these files will change accordingly.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.