How do I use SAS on a Unix system?
You can access SAS interactively, non-interactively, and as a background process on most Unix systems on which it is installed. At Indiana University, SAS is available on Quarry.
Note: To access SAS on Quarry, you need to temporarily add a SAS keyword to your software environment using the following command:
soft add +sasYou can also change your environment permanently by editing your
~/.soft file. For more, see On Big Red and Quarry at IU, how can I use SoftEnv to customize my software environment?
Interactive mode
To run SAS interactively, at the Unix prompt, enter:
sas -nodmsThe SAS prompt (1?) will appear on the screen. The number
appearing with the prompt will increase with each command line. Enter
your command(s) and terminate each SAS command with
; (the semicolon). For example, to execute a
statement, enter:
To end the session, at the SAS prompt, enter:
endsas;Non-interactive mode
To run a SAS job non-interactively, at the Unix prompt, enter:
sas program.sasReplace program.sas with your SAS program's
filename. When the job has been executed, two new files will exist in
your default directory. The SAS log, program.log, will
contain the code that was run along with any notes, warnings, or
errors that resulted during execution. The listing report,
program.lst, will contain output from the program, if
any. In both cases, program represents the name of your
SAS program file. If your program file contains errors, the
.lst file may not be generated.
As a background process
When you run a non-interactive job, your terminal is not free for
other computing tasks until the job is completed. If you want to use
your terminal for computing activities while the job runs in the
background, include & (the ampersand) at
the end of the command:
Again, replace program with the name of your SAS program.
This will free your terminal for other computing tasks while the job
runs in the background. When the job is completed, a message will be
displayed on the screen, and the .log and the
.lst files will be stored in the default directory.
For additional information on running SAS on Unix, see Getting Started with SAS for Unix.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on January 31, 2011.







