Chapter Contents


SAS Companion for UNIX Environments

Starting SAS Sessions

Note:   Before you start your SAS session, review the different methods for interrupting and terminating your SAS session (see Interrupting or Terminating Your SAS Session). Also, if you cannot stop your session, contact your system administrator; do not turn off your machine, especially if your machine is part of a network.  [cautionend]

Starting a SAS Session

The command that you use to invoke your SAS session is defined during the SAS installation process and is added to the list of commands that are recognized by the operating environment. Ask your system administrator what the command is that invokes SAS at your site. At many sites, the command to invoke SAS is simply sas, but a different command may have been defined during the SAS installation process at your site. This book assumes that the SAS System is invoked by 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 a SAS system option to configure your session or an X command line option. See SAS System Options 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 System's (or site-specific) default options are in effect.

is 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 in your current directory and has a .sas extension, you can omit its extension. If the file is not in the current directory, specify its full pathname.

For example, to invoke an interactive SAS session, without specifying any SAS system options, enter


The execution mode will depend on your default settings.

To specify the NODATE and LINESIZE system options, you could enter

sas -nodate -linesize 80

To run a SAS program and pass parameters to it, enter

sas -sysparm 'A B C'
The value A B C is assigned to the SYSPARM macro variable, which can be read by the program

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.