SET System Option: Windows

Defines a SAS environment variable.

Valid in: configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Category: Environment Control: Files
PROC OPTIONS GROUP= ENVFILES
Default: none
Windows specifics: Values intended to represent files or paths must be valid under Windows

Syntax

-SET SAS-variable "value" | ("value-1"…<"value-n"> )
SET=SAS-variable "value" | (" value-1"…<"value-n"> )

Syntax Description

SAS-variable

specifies the environment variable to define.

value

specifies the value or set of values to assign to the environment variable. If value is a pathname that contains spaces, enclose value in quotation marks.

Details

This action is analogous to defining a Windows environment variable with the Windows SET command. One way to use the SET system option is to set up environment variables that represent commonly used external files. For example, the following code defines an environment variable for the sample source library:
-set sampsrc (!sasroot\base\sample
              !sasroot\stat\sample
              !sasroot\graph\sample)
When you refer to SAMPSRC as a library name during your SAS session, SAS automatically assigns the library with the directories listed. Note that !sasroot is also a SAS environment variable that represents the root directory of your SAS installation, and is typically assigned in the SAS configuration file.
Environment variables only can be used as a libref if you use the SET system option at SAS invocation and not in an OPTIONS statement.
If you specify SET on the command line when you start SAS, the variable is set only for that SAS session. To set an environment variable for repeated use, either add the SET system option to your configuration file or create a Windows environment variable.
You can use the APPEND and INSERT system options to add additional file specifications.
Note: The words AUX, CON, NUL, LPT1 - LPT9, COM1 - COM9, and PRN are reserved words under Windows. Do not use CON or NUL as environment variable names.

See Also

APPEND= System Option in SAS System Options: Reference
INSERT= System Option in SAS System Options: Reference