Using SAS System Options

Default Settings

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. Your on-site SAS support personnel might have customized configuration files in order to provide a global set of default values that are specific for your site.
Information about creating customized configuration files is provided in the configuration guide for SAS software for your operating environment.

Saving and Loading SAS System Options

SAS system options can be saved to either the SAS registry or a SAS data set by using the OPTSAVE procedure or by using the DMOPTSAVE command in the SAS windowing environment. Some system options cannot be saved. You can specify DEFINE in the OPTIONS procedure to determine whether an option can be saved. In the log output, the line that begins with Optsave: indicates whether the option can be saved.
proc options option=pageno define;
run;
8    proc options option=pageno define;
9    run;

    SAS (r) Proprietary Software Release 9.3  TS1B0

 PAGENO=1
Option Definition Information for SAS Option PAGENO
    Group= LISTCONTROL
    Group Description: Procedure output and display settings
    Description: Beginning page number for the next page of output produced by the SAS System
    Type: The option value is of type LONG
          Range of Values: The minimum is 1 and the maximum is 2147483647
          Valid Syntax(any casing): MIN|MAX|n|nK|nM|nG|nT|hexadecimal
    Numeric Format: Usage of LOGNUMBERFORMAT does not impact the value format
    When Can Set: Startup or anytime during the SAS Session
    Restricted: Your Site Administrator can restrict modification of this option
    Optsave: PROC Optsave or command Dmoptsave will save this option
    
For a list of all options that can be saved, submit the OPTIONS procedure and the PRINT procedure:
proc optsave; 
run;
proc print; 
   var optname;
run;
For information about saving options, see OPTSAVE Procedure.
To load a set of saved system options you use either the OPTLOAD procedure or the DMOPTLOAD command. For information about loading system options, see OPTLOAD Procedure.
For information about the DMOPTSAVE command and the DMOPTLOAD command, see the SAS Help and Documentation.

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 system options that were specified on the SAS invocation command line. (See the SAS documentation for your operating environment for more information.)
VERBOSE system option
Writes to the SAS log the system options that were specified in the configuration file and on the SAS invocation command line.
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 as error handling, use the GROUP= option: proc options GROUP=errorhandling; run; For more information, see OPTIONS Procedure.
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, a description of each option, the option type, whether the option is a portable or a host option, when the option can be set, and the group to which the option belongs. You can view this table with SAS Explorer, print the table by using the PRINT procedure, or you can extract information from the VOPTION table by using the SQL procedure.
dictionary.options SQL table
Accessed with the SQL procedure, this table lists the system options that are in effect.

Restricted Options

Restricted options are system options whose values are determined by the site administrator and cannot be overridden. The site administrator can create a restricted options table that specifies the option values that are restricted when SAS starts. Any attempt to modify a system option that is listed in the restricted options table results in a message to the SAS log indicating that the system option has been restricted by the site administrator and cannot be updated.
To determine which system options are restricted by your site administrator, use the RESTRICT option of the OPTIONS procedure. The RESTRICT option displays the option's value, scope, and setting. In the following example, the SAS log shows that only one option, CMPOPT, is restricted:
proc options restrict;
run;
Restricted Option Information

1
   proc options restrict;
2    run;
    SAS (r) Proprietary Software Release xxx  TS1B0

Option Value Information For SAS Option CMPOPT
    Value: (NOPRECISE NOEXTRAMATH NOMISSCHECK NOGUARDCHECK NOGENSYMNAMES 
NOFUNCDIFFERENCING)
    Scope: SAS Session
    How option value set:  Site Administrator Restricted
The OPTIONS procedure displays this information for all options that are restricted. If your site administrator has not restricted any options, then the following message appears in the SAS log:
Your site administrator has not restricted any options.
You can use the OPTIONS procedure option LISTRESTRICT to view the options that your site administrator can restrict. These are not options that are restricted, but can be restricted.
proc options listrestrictable;
run;
Partial Listing of Options That Can Be Restricted
13   proc options listrestrict ;
14   run;

    SAS (r) Proprietary Software Release xxx  TS1B0


    Your Site Administrator can restrict the ability to modify the following Portable Options:

     APPLETLOC          Location of Java applets
     ARMAGENT           ARM Agent to use to collect ARM records
     ARMLOC             Identify location where ARM records are to be written
     ARMSUBSYS          Enable/Disable ARMing of SAS subsystems
     AUTOCORRECT        Perform auto-correction for misspelled procedure names, keywords or global statement names
     AUTOSAVELOC        Identifies the location where program editor contents are auto saved
     AUTOSIGNON         SAS/CONNECT remote submit will automatically attempt to SIGNON
     BINDING            Controls the binding edge for duplexed output
     BUFNO              Number of buffers for each SAS data set
     BUFSIZE            Size of buffer for page of SAS data set
     BYERR              Set the error flag if a null data set is input to the SORT procedure
     BYLINE             Print the BY line at the beginning of each BY group
     BYSORTED           Require SAS data set observations to be sorted for BY processing
     CAPS               Translate SAS source and data lines to uppercase
     CARDIMAGE          Process SAS source and data lines as 80-byte records
     CATCACHE           Number of SAS catalogs to keep in cache memory
     CBUFNO             Number of buffers to use for each SAS catalog
     CENTER             Center SAS procedure output
     CGOPTIMIZE         Control code generation optimization
     CHARCODE           Uses character combinations as substitute for special characters  not on the keyboard
     CLEANUP            Attempt recovery from out-of-resources condition
     CMDMAC             Support command-style macros
     CMPLIB             Identify previously compiled libraries of CMP subroutines to use when linking
For information, see OPTIONS Procedure.
The following table lists the system options that cannot be restricted:
System Options That Cannot Be Restricted
Option
All Operating Environments
OpenVMS
UNIX
Windows
z/OS
ALTLOG
X
ALTPRINT
X
APPEND
X
ASYNCHIO
X
AUTOEXEC
X
BOMFILE
X
BOTTOMMARGIN
X
COMDEF
X
X
CONFIG
X
CPUCOUNT
X
DATESTYLE
X
DBCS
X
DFLANG
X
DLDMGACTION
X
DMR
X
DMS
X
DMSEXP
X
DMSPGMLINESIZE
X
ENGINE
X
EXPLORER
X
FILELOCKWAITMAX
X
X
INITCMD
X
INITSTMT
X
INSERT
X
JREOPTIONS
X
LEFTMARGIN
X
LINESIZE
X
_LAST_
X
LOG
X
LOGAPPLNAME
X
LOGPARM
X
MEMCACHE
X
MEMLIB
X
METAPASS
X
METAPROTOCOL
X
METAREPOSITORY
X
METASERVER
X
METAUSER
X
MSYMTABMAX
X
MVARSIZE
X
OBJECTSERVER
X
ORIENTATION
X
OVP
X
PAGESIZE
X
PAPERSIZE
X
PATH
X
PDFPASSWORD
X
PRINT
X
PRINTERPATH
X
RESOURCESLOC
X
RIGHTMARGIN
X
SASCONTROL
X
SASFRSCR
X
SASUSER
X
SGIO
X
SOURCE
X
SSLPKCS12LOC
X
SSLPKSC12PASS
X
SSPI
X
STARTLIB
X
SYSIN
X
SYSPRINTFONT
X
TERMINAL
X
TOOLDEF
X
TOPMARGIN
X
TRANTAB
X
USER
X
WORK
X

Determining How a SAS System Option Value Was Set

To determine how a system option value was set, use either the OPTIONS procedure or the GETOPTION function:
  • Use the OPTIONS procedure with the VALUE option specified in the OPTIONS statement. The VALUE option displays the specified option's value and scope.
  • Use the GETOPTION function as an argument to the %SYSFUNC macro function:
    %put %sysfunc(getoption(option-name, howset));
This example shows how the option value for the system option CENTER was set using the OPTIONS procedure:
proc options option=center value;
run;
The following partial SAS log shows that the option value for CENTER was the shipped default.
Option Value Information for the System Option CENTER


2    proc options option=center value;
3    run;


Option Value Information for SAS Option CENTER
    Option Value: CENTER
    Option Scope: Default
    How option value set:  Shipped Default

If a SAS option is set from a configuration file, SAS diplays the name of the configuration file that set the option.
Option Value Information Showing an Option Set by a Configuration File
7    proc options option=work value;
8    run;

    SAS (r) Proprietary Software Release xxx  TS1B0

Option Value Information For SAS Option WORK
    Value: C:\DOCUME~1\sasuser1\LOCALS~1\Temp\SAS Temporary Files\_TD5428_t20111_
    Scope: SAS Session
    How option value set: Config File
    Config file name:
            C:\SASv9\SASv9.cfg
If a SAS option is modified using the INSERT or APPEND system options, you can use the VALUE option in a PROC OPTIONS statement to show that the value was inserted or appended:
Option Value Information for an Option Modified by the INSERT and APPEND Options
24   options insert=(fmtsearch="c:/myformats");
25   options append=(fmtsearch="c:/mysas");
26   proc options option=fmtsearch value;
27   run;

    SAS (r) Proprietary Software Release xxx  TS1B0

Option Value Information For SAS Option FMTSEARCH
    Value: ('C:/MYFORMATS' WORK LIBRARY 'C:/MYSAS')
    Scope: DMS Process
          How option value set: Options Statement
          Value Inserted: 'C:/MYFORMATS'

          How option value set: Options Window
          Value: WORK LIBRARY

          How option value set: Options Statement
          Value Appended: 'C:/MYSAS'
If no value is assigned to a character system option, then SAS assigns the option a value of ' ' (a space between two single quotation marks) and Option Value displays a blank space.

Obtaining Descriptive Information about a System Option

You can quickly obtain basic descriptive information about a system option by specifying the DEFINE option in the PROC OPTIONS statement.
The DEFINE option writes the following descriptive information about a system option to the SAS log:
  • the value of the option
  • a description of the option
  • the name and description of each system option group that the option is a part of
  • type information, such as whether it is numeric or character, whether to expand a value that is an environment variable, and valid values for the option
  • when in the SAS session it can be set
  • if it can be restricted by the system administrator
  • if the OPTSAVE procedure or the DMOPTSAVE command will save the option
For example, the following statements write a message to the SAS log that contains descriptive information about the system option ERRORCHECK:
proc options option=errorcheck define;
run;
Descriptive Information about the System Option ERRORCHECK
5    proc options option=errorcheck define;
6    run;

    SAS (r) Proprietary Software Release xxx  TS1B0

 ERRORCHECK=NORMAL
Option Definition Information for SAS Option ERRORCHECK
    Group= ERRORHANDLING
    Group Description: Error messages and error conditions settings
    Description: Level of special error processing to be performed
    Type: The option value is of type CHARACTER
          Maximum Number of Characters: 10
          Casing: The option value is retained uppercased
          Quotes: If present during "set", start and end quotes are removed
          Parentheses: The option value does not require enclosure within parentheses. If present, the parentheses are
          retained.
          Expansion: Environment variables, within the option value, are not expanded
          Number of valid values: 2
               Valid value: NORMAL
               Valid value: STRICT
    When Can Set: Startup or anytime during the SAS Session
    Restricted: Your Site Administrator can restrict modification of this option
    Optsave: PROC Optsave or command Dmoptsave will save this option
  

Changing SAS System Option Settings

SAS provides default settings for SAS system options. You can override the default settings of any unrestricted system option in several ways, depending on the function of the system option:
  • On the command line or in a configuration file:
    specify any unrestricted SAS system option setting either on the SAS command line or in a configuration file. If you use the same option settings frequently, then it is usually more convenient to specify the options in a configuration file, rather than on the command line. 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 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, change them in the SAS System Options window, or use the OPTLOAD procedure to load previously saved options from a data set. You can also place an OPTIONS statement in an autoexec file.
    By specifying either the INSERT or APPEND option in the OPTIONS statement, you can add a value to certain system options that name libraries or files, such as the AUTOEXEC option and the FMTSEARCH option. For more information, see Changing an Option Value by Using the INSERT and APPEND System Options.
  • In the OPTLOAD procedure or the DMOPTLOAD command:
    You can use the OPTLOAD procedure or the DMOPTLOAD command to read option settings that were specified with the OPTSAVE procedure and saved to a SAS data set.
  • In a SAS System Options window:
    If you are in a windowing environment, type options in the toolbar or on the command line to open the SAS System Options window. The SAS System Options window lists the names of the SAS system option groups. You can then expand the groups to see the option names and to change their current settings to a new value or to the default value. Alternatively, you can use the Find Option command in the Options pop-up menu to go directly to an option. 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.
SAS system options can be restricted by a site administrator so that after they are set by the administrator, they cannot be changed by a user. Depending on your operating environment, system options can be restricted globally, by group, or by user. You can use the OPTIONS procedure to determine which options are restricted. For more information, see OPTIONS Procedure and the SAS documentation for your operating environment. For more information about how to restrict options, see your site administrator.

Changing an Option Value by Using the INSERT and APPEND System Options

You can use the INSERT and APPEND options to modify the values of these options:
Option
Where the Option Can Be Set
AUTOEXEC
configuration file, SAS invocation
CMPLIB
configuration file, SAS invocation, OPTIONS statement, SAS System Options window
FMTSEARCH
OPTIONS statement, SAS System Options window
HELPLOC
configuration file, SAS invocation
MAPS
configuration file, SAS invocation, OPTIONS statement, SAS System Options window
MSG
configuration file, SAS invocation
SASAUTOS
configuration file, SAS invocation, OPTIONS statement, SAS System Options window
SASHELP
configuration file, SAS invocation
SASSCRIPT
configuration file, SAS invocation, OPTIONS statement, SAS System Options window
SET
configuration file, SAS invocation
The value of these options is one or more libraries, files, or environment variables. You use the INSERT option to insert a value before the current value. You use the APPEND option to append a value to the end of the current value. Use the LISTINSERTAPPEND option in the PROC OPTIONS statement to see a list of options in the SAS log that you can use with the INSERT option and the APPEND option:
1    proc options listinsertappend;
2    run;

    SAS (r) Proprietary Software Release xxx  TS1B0


    Core options that can utilize INSERT and APPEND

     AUTOEXEC           Identifies AUTOEXEC files used during initialization
     CMPLIB             Identify previously compiled libraries of CMP subroutines 
                        to use when linking
     FMTSEARCH          List of catalogs to search for formats and informats
     MAPS               Location of maps for use with SAS/GRAPH
     SASAUTOS           Search list for autocall macros
     SASHELP            Location of the SASHELP library
     SASSCRIPT          Location of SAS/CONNECT script files

    Host options that can utilize INSERT and APPEND

     HELPLOC            Location of help environment text and index files
     MSG                The path to the sasmsg directory
     SET                Defines an environment variable
The syntax for the INSERT option and the APPEND option is different when you start SAS as compared to using the OPTIONS statement after SAS starts. For the correct syntax to use when SAS starts, see the documentation for your operating environment:
If you specify the INSERT option or the APPEND option after SAS starts, the syntax requires parentheses and is the same for all operating environments:
insert=(system-option-1=argument-1 system-option-n=argument-n)
append=(system-option-1=argument-1 system-option-n=argument-n)
The syntax for system-option=argument is the syntax that is required for the specified system option.
Here are two examples:
options insert=(fmtsearch="c:/myformats");
options append=(fmtsearch=("c:/mysasfmt" "u:/mysasfmt2"));
For more information, see INSERT= System Option and APPEND= System Option.
You can use the VALUE option in the PROC OPTIONS statement to display values that have been inserted or appended to an option value:
26   proc options option=fmtsearch value;
27   run;

    SAS (r) Proprietary Software Release xxx  TS1B0

Option Value Information For SAS Option FMTSEARCH
    Value: ('C:/MYFORMATS' WORK LIBRARY 'C:/MYSAS')
    Scope: DMS Process
          How option value set: Options Statement
          Value Inserted: 'C:/MYFORMATS'

          How option value set: Shipped Default
          Value: WORK LIBRARY

          How option value set: Options Statement
          Value Appended: 'C:/MYSASFMT' 'U:/MYSASFMT2'
SAS inserts or appends values as they are specified in the INSERT and APPEND system options. SAS does not check for duplicate values.
The INSERT and APPEND system options only add values to a system option’s value. To delete a value from a system option, set the option to the value that you want.

Resetting System Options to the Default or Starting Value

Reset Options to the Default Value by Using the SAS System Options Window

To reset a system option to the default option by using the SAS System Options window:
  1. From the SAS menu bar, select Toolsthen selectOptionsthen selectSystem.
  2. Right-click Options and select Find Option.
  3. Type the option name and click OK.
  4. Right-click the option name and select Set to Default.

Reset Options to the Default or Starting Value by Using the %Put Macro and the GETOPTIONS Function

You can use the SAS System Options window or macro processing and the GETOPTION function together to set a system option to the default value or to the value that was specified when SAS started.
You use the GETOPTION function DEFAULTVALUE option to set a system option its default value. You use the GETOPTION function STARTUPVALUE option to set a system option to the starting value.
The following code is an example of setting the PAPERSIZE= system option to its default value and to its starting value:
/* Check the value of papersize before we change it.    */
 /* The inital value is A4 as this value was used when         */  
/* SAS started.                                                */
 
   %put %sysfunc(getoption(papersize,keyword));

/* Change the PAPERSIZE value and check the change.            */

   options papersize="600x800 Pixels";

   %put %sysfunc(getoption(papersize,keyword));
 
/* Change PAPERSIZE back to the default value and check it.    */
/* RESULT:  LETTER                                             */

   %let defsize = %sysfunc(getoption(papersize,keyword,defaultvalue)) ;
   options &defsize; run;
   %put %sysfunc(getoption(papersize,keyword));

/* Change the value to the startup value and check it.         */
/* RESULT:  A4                                                 */

   %let defsize = %sysfunc(getoption(papersize,keyword,startupvalue)) ;
   options &defsize; run;
   %put %sysfunc(getoption(papersize,keyword));
The SAS log displays the following lines:
22   /* Check the value of papersize before we change it.    */
23    /* The inital value is A4 as this value was used when         */
24   /* SAS started.                                                */
25
26      %put %sysfunc(getoption(papersize,keyword));
PAPERSIZE=A4
27
28   /* Change the PAPERSIZE value and check the change.            */
29
30      options papersize="600x800 Pixels";
31
32      %put %sysfunc(getoption(papersize,keyword));
PAPERSIZE=600X800 PIXELS
33
34   /* Change PAPERSIZE back to the default value and check it.    */
35   /* RESULT:  LETTER                                             */
36
37      %let defsize = %sysfunc(getoption(papersize,keyword,defaultvalue)) ;
38      options &defsize; run;
39      %put %sysfunc(getoption(papersize,keyword));
PAPERSIZE=LETTER
40
41   /* Change the value to the startup value and check it.         */
42   /* RESULT:  A4                                                 */
43
44      %let defsize = %sysfunc(getoption(papersize,keyword,startupvalue)) ;
45      options &defsize; run;
46      %put %sysfunc(getoption(papersize,keyword));
PAPERSIZE=A4
For more information, see GETOPTION function.

How Long System Option Settings Are in Effect

When you specify a SAS system option setting, the setting applies to the next step and to all subsequent steps for the duration of the SAS session, or until you reset the system option setting, 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= System Option.

Order of Precedence

If the same system option appears in more than one place, the order of precedence from highest to lowest is the following
  1. restricted options table, if it exists
  2. OPTIONS statement and SAS System Options window
  3. autoexec file (that contains an OPTIONS statement)
  4. command-line specification
  5. configuration file specification
  6. 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.
The following table 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.
Order of Precedence for SAS Execution Mode Options
Execution Mode Option
Precedence
OBJECTSERVER
Highest
DMR
2nd
SYSIN
3rd
INITCMD
4th
DMS
4th
DMSEXP
4th
EXPLORER
4th
none (default is interactive line mode under UNIX and interactive full screen mode under z/OS)
5th
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 until their settings are changed. A data set option, however, overrides a system option only for the particular data set in 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, overrides the system option and specifies that only the first five 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;