Previous Page | Next Page

Getting Started with SAS in UNIX Environments

Starting SAS Sessions in UNIX Environments

Invoking SAS

A SAS session is invoked using a link in the !SASROOT directory. Your UNIX administrator can add this link to the list of commands for your operating environment.

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 (see Exiting or Interrupting Your SAS Session in UNIX Environments). Also, if you cannot stop your SAS session, contact your system administrator.  [cautionend]

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 !SASROOT 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.

Regenerating SAS Invocation Scripts

The SAS invocation scripts that exist in !SASROOT/bin should not be modified. SAS Setup enables you to regenerate the default SAS invocation scripts that are located in !SASROOT/bin. To regenerate the invocation scripts, perform the following steps:

  1. Run SAS Setup from !SASROOT/sassetup. Make sure that you have the appropriate privilege to update files in SASROOT.

  2. Select Run Setup Utilities from the SAS Setup Primary Menu.

  3. Select Perform SAS Software Configuration.

  4. Select Recreate the SAS Invocation Scripts.

Syntax of the SAS Command

The general form of the SAS command is as follows:

sas <-option1...-option-n> <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. See System Options under UNIX and X Command Line Options for more information. 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.


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.

Example: Invoke an Interactive SAS Session

To invoke an interactive SAS session, without specifying any SAS system options, enter


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?

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 SAS console log.

Under UNIX, the STDOUT fileref specifies the location of the console log.

Previous Page | Next Page | Top of Page