AUTOEXEC System Option: UNIX

Specifies the SAS autoexec file.
Valid in: configuration file, SAS invocation, SASV9_OPTIONS environment variable
Category: Environment control: Files
PROC OPTIONS GROUP= ENVFILES
Default: autoexec.sas (see Details)
UNIX specifics: all

Syntax

-AUTOEXEC file-specification | -NOAUTOEXEC
-AUTOEXEC \ (file-specification-1 <...file-specification-n>\)

Required Arguments

-NOAUTOEXEC
specifies that SAS is not to process any autoexec files.
file-specification
specifies the SAS autoexec file to be used instead of the default autoexec.sas file. The file-specification argument can be a valid Windows filename or an environment variable that is associated with a pathname. For more information, see SAS Autoexec File in SAS Companion for Windows.

Details

The Autoexec File

The AUTOEXEC system option specifies the autoexec file. The autoexec file contains SAS statements that are executed automatically when you invoke SAS, or when you start another SAS process. The autoexec file can contain any SAS statements. For example, your autoexec file can contain LIBNAME statements for SAS libraries that you access routinely in SAS sessions.
SAS looks for the AUTOEXEC system option in the following order. It uses the first AUTOEXEC system option that it finds:
  1. in the command line
  2. in the SASV9_OPTIONS environment variable
  3. in the configuration file
SAS uses the first AUTOEXEC option that it encounters and ignores all others.
If neither the AUTOEXEC nor NOAUTOEXEC system option is found, SAS looks for the autoexec file in three directories in the following order:
  1. your current directory
  2. your home directory
  3. the !SASROOT directory (For more information, see The !SASROOT Directory.)
    SAS uses the first autoexec file that it finds to initialize the SAS session.
If you want to see the contents of the autoexec file for your session, use the ECHOAUTO system option when you invoke SAS. If you want to identify the data sources that the autoexec file is using, use the PROC OPTIONS statement:
proc options option=autoexec value; 
run;

Inserting and Appending Autoexec Files

You can concatenate files in your autoexec file by using the following system options with the AUTOEXEC system option:INSERT and APPEND. The autoexec file is always a UNIX file. If your filename contains embedded blanks or special characters, you must enclose the filename in quotation marks. Otherwise, quotation marks are optional when one or more filenames are specified.
You can use the following syntax to concatenate autoexec files:
-autoexec "(/path1/autoexec.sas  /path2/autoexec.sas  /path3/autoexec.sas)"
You can use the following syntax with the INSERT system option:
-insert autoexec "a.sas" –insert autoexec "b.sas"
You can use the following syntax with the APPEND system option:
-append autoexec "a.sas" –append autoexec "b.sas"