Previous Page | Next Page

SAS System Options under Windows

Changing SAS System Option Settings

There are several ways to specify values for SAS system options:

Some system options can be specified only when a SAS session or process is initialized (starts up), while other options can be changed as needed during your SAS session.

It is important to remember the differences in syntax between specifying a system option in the SAS command when you start SAS or in the SAS configuration file, and specifying a system option in the OPTIONS statement. The syntax for these situations is different, and if you use the wrong syntax, SAS generates an error message. For information on the OPTIONS statement, see SAS Language Reference: Dictionary.


Syntax for System Options in the SAS Invocation or SAS Configuration File

When you specify a system option at initialization, it must be preceded by a hyphen (-). For on or off options, just list the keyword corresponding to the appropriate setting. For example, the following command invokes SAS and indicates that SAS output should not be centered:

c:\sas\sas.exe -nocenter

For options that take a value, do not use an equal sign; follow the option name with a space and then the value. For example, the following SAS command invokes SAS with a line length of 132:

c:\sas\sas.exe -linesize 132

Physical names (that is, directory names or filenames) should be enclosed in double quotation marks when you use them in the SAS command or in the SAS configuration file. The quotation marks are especially necessary when the file or pathname that you are specifying contains a space or single quotation mark character, which are valid characters in Windows filenames. For example, the following SAS command invokes SAS and indicates that autocall macros are stored in the C:\SAS\CORE\SASMACRO directory:

c:\sas\sas.exe -sasautos "c:\sas\core\sasmacro"

Double quotation marks are also needed when an option value contains '=', as shown in this example:

c:\sas\sas.exe -set fruit "navel=orange"

To specify more than one option in the SAS command, simply separate each option with a space. For example, the following SAS command combines the three options shown previously in this section:

c:\sas\sas.exe -linesize 132 -nocenter
               -sasautos "c:\sas\core\sasmacro"

The SAS configuration file must contain only option settings; it cannot contain SAS statements. The file can contain SAS comments. For example, a configuration file named MySASConfig.CFG can contain these option specifications (among others):

-nocenter 
-noxwait 
-pagesize 60

All SAS system options can appear in a SAS configuration file. For more information on SAS configuration files, see SAS Configuration Files.


Syntax for Concatenating Libraries in SAS System Options

To provide more flexibility for storing SAS files across different drives, such as multiple logical drives on your hard disk or on a network, SAS lets you concatenate SAS libraries. The concept of concatenation within SAS means that you can specify multiple drives or directories when you specify certain system options in the SAS configuration file or in the SAS command. To specify concatenated directories, specify the directory names inside parentheses, enclose each directory name in double quotation marks, and separate the directory names with spaces.

One practical use of concatenation is the storage of SAS help catalogs. If you want to partition your SAS products among two or more directories, simply specify these multiple directories with the SASHELP option in the SAS configuration file, as in the following example:

-sashelp ("c:\sas\core\sashelp"
          "d:\sas\stat\sashelp")


Syntax for System Options in the OPTIONS Statement

You can specify many 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 with another OPTIONS statement or load a previously saved set of option values using PROC OPTLOAD or the DMOPTLOAD command. For more information about the OPTIONS statement, see SAS Language Reference: Dictionary.

When you specify a system option in the OPTIONS statement, do not precede the option name with a hyphen (-). Also, for system options that take a value, use an equal sign (=), not a space. For example, the following statement specifies that output is not to be labeled with a date and that the line size should be 132:

options nodate linesize=132;

Physical names (that is, directory names or filenames) must be enclosed in quotation marks when used in the OPTIONS statement. For example, the following OPTIONS statement indicates that autocall macros are stored in the C:\SAS\CORE\SASMACRO directory:

options sasautos="c:\sas\core\sasmacro";

Any file specification that is not enclosed in quotation marks in the OPTIONS statement is assumed to be a logical name, that is, a fileref or an environment variable name. If no logical name is found, SAS issues an error message.

Not all system options can be specified in the OPTIONS statement. To find out whether a system option can be specified in the OPTIONS statement, look up the option name in Summary of SAS System Options, which summarizes all SAS system option information, including where you can specify the options or use PROC OPTIONS

option=optname define;
run;

.

Previous Page | Next Page | Top of Page