Creating SAS Programs at UMBC

Running SAS

Under VMS, no additional steps are required on the part of the user to run SAS. The command line options are listed in the SAS Section of Using VAX/VMS at UMBC.

Under Unix, no additional steps should be required to run SAS. If you encounter a problem you must verify that the directory /usr/local/sas is in your command path via the Unix command:
echo $PATH
If not, then enter the Unix command:
set path=(/usr/local/sas $path)

Under Unix, we have seen a bug introduced in SAS version 6.10 where SAS will not access the data set under a NFS mounted file system. If this happens use the option -filelocks none with your SAS command. We are working on a permanent fix to this.

To run sas on a file named myprogram.sas you would enter the following command:

sas myprogram.sas

File Naming Strategy for SAS

Managing sas files is easy if you follow some basic guidelines:
  1. Pick a good meaningful name for the sas file component.
  2. SAS program files should always end in .sas.
  3. Statistical output from a SAS program will have the same meaningful name you selected in step 1 but the file type will be .lst (note: under VMS the file type will be .LIS).
  4. Comments, Warnings, and Error statements that SAS produced when it ran the SAS program file are stored under the name selected in Step 1. but with a file type of .log

When running your sas program it is very important to check the log file after each run. My examining the log file you can determine if sas ran properly. If not, the log file will identify statement errors and assist you in fixing your program.

Batch Mode versus Display Manager Mode

SAS programs can be run through two methods, the SAS Display Manager or SAS Batch Mode. With Batch mode, you create a file with the sas commands you want included in that file and then you invoke sas to process those commands. With this method you can create and run SAS jobs locally or from home. All you need to learn is a text editor program such as pico or emacs. By default, SAS is configured to use Batch Mode at UMBC. On some department machines using SAS you will find that Batch Mode is not the default mode. If that happens add the following command option to SAS to use Batch mode, -nodms .

SAS Display Manager mode allows you to create, run, and view the results of your SAS program all from within SAS. If your workstation supports the X11 protocol you may find that SAS Display Manager mode is convienent; otherwise most people find batch mode to be preferable when using telnet or other terminal emulator programs. When using the X11 Display Manager sas will attempt to create at least 4 windows on your screen. When using a PC this can be complicated to manage.

UCS has a site license for the Digital eXcursions package. With this package you can run X11 applications from a Unix server to your PC. This package can be found on the campus Novell servers or can be loaded onto your hard disk. It requires 8MB of RAM to run properly. With eXcursions you could use the Display Manager mode. To use Display Manager mode enter the command:
sas -dms -fsdevice x11.motif

Author - Jack Suess
Created - 1/15/96