Starting SAS Sessions in UNIX Environments

Invoking SAS

A SAS session is invoked using a link in the !SASROOT directory. (The !SASROOT directory is a term that represents the name of the directory or folder in which SAS is installed at your site or on your computer.) Your UNIX administrator can add this link to the list of commands for your operating environment. For more information about the !SASROOT directory, see Introduction to the !SASROOT Directory.
Ask your system administrator for the command that invokes SAS at your site. At many sites, the command to invoke SAS is sas, but a different command might have been defined during the SAS installation process at your site. This documentation assumes that SAS is invoked by the sas command.
Note: Before you start your SAS session, review the different techniques for interrupting and terminating your SAS session. For more information, see Exiting or Interrupting Your SAS Session in UNIX Environments. Also, if you cannot stop your SAS session, contact your system administrator.

SAS Invocation Scripts

SAS is invoked by scripts that are located in the !SASROOT/bin directory. A SAS invocation script is created for each language that is installed. The invocation scripts are named using the language codes of the installed language. For example, sas_en invokes the English version of SAS. All languages are installed in all locations.
For more information about setting up SAS, refer to the installation documentation for the UNIX environment.

SAS Configuration Files

SAS creates a separate configuration file for each language that is installed. The language-specific configuration files have the form !SASROOT/nls/<language>/sasv9.cfg for each language. An additional configuration file that is language independent is !SASROOT/sasv9.cfg. This master configuration file in is used by all languages in addition to the language-specific files in !SASROOT/nls/<language>/. You can modify these configuration files to meet your needs. For information about how to customize SAS configuration files, see Customizing Your SAS Session by Using Configuration and Autoexec Files.

Syntax of the SAS Command

The general form of the SAS command is as follows:
sas <-option1…-option-n> <filename>
sas –sysin filename
You can use these arguments with the SAS command:
-option1 ... -option-n
specifies SAS system options to configure your session or X command line options. For more information, see SAS System Options under UNIX and X Command Line Options. If you omit any options (either on the command line or in the configuration file), the SAS (or site-specific) default options are in effect.
filename
specifies the name of the file containing the SAS program to be executed. Specifying a filename on the SAS command invokes a batch SAS session. Omit the filename to begin an interactive session.
If the file is not in the current directory, specify its full pathname. A .sas extension is inferred if the full pathname is not given.
Note: This command can fail in cases where an option does not recognize filename. In this case, -sysin filename is required.

Example: Invoke an Interactive SAS Session

To invoke an interactive SAS session, without specifying any SAS system options, enter
sas
The execution mode will depend on your default settings. For more information, see Selecting a Method of Running SAS in UNIX Environments.
To specify the NODATE and LINESIZE system options, you could enter
sas -nodate -linesize 80

What If SAS Does Not Start?

There are several reasons why SAS might not start. Three reasons are listed here:
  • SAS will not start if you specify an autoexec file that does not exist. An error message will appear in the SAS log stating that the physical file does not exist.
  • SAS will not start if you specify invalid options, such as a misspelled option: ./sas —nodms —stimerr (stimer is misspelled).
  • SAS will not start if SAS cannot find the configuration file. This error normally indicates an installation problem.
If SAS does not start, the SAS log might contain error messages that explain the failure. However, error messages that SAS issues before the SAS log is initialized are written to the console log. With the addition of better error handling, a failure could cause information to be written to standard output as well.
If the system is not patched correctly, SAS can generate an error such as NLS Extension Failure. This and other types of error messages indicate that the installation did not set up the search rules correctly.
Under UNIX, the STDOUT fileref specifies the location of the console log.