Running SAS

There are several ways to run SAS. The default methods is semi-interactive, employing the "SAS Program Editor" in one of several windows, and requires X-Windows on cquest. The method recommended in our course is running SAS from the unix command line. For a description of some useful unix commands,including all the ones used in this handout, see the unix handout

The following shows part of a typical session. The unix command prompt is > . You can see that initially, there are just two files in the directory -- intro.sas (the command file or program) and oldclass.dat (the raw data file).


> ls
intro.sas       oldclass.dat
> less oldclass.dat
1  2  9  1  7  8  4  3  5  2  6  10  10  10  5  0  0  0  0  55  43
0  2  10  10  5  9  10  8  6  8  10  10  8  9  9  9  9  10  10  66  79
1  2  10  10  5  10  10  10  9  8  10  10  10  10  10  10  9  10  10  94  67
1  2  10  10  8  9  10  7  10  9  10  10  10  9  10  10  9  10  10  81  65
0  1  10  1  0  0  8  6  5  2  10  9  0  0  10  6  0  5  0  54  29 


And so on. There are 21 columns and 62 rows of data; columns not aligned. This is a typical data file, in which the rows are cases, and the columns are variables. If there are lots of variables, you may need more than one line of data for each case. In this instance the cases are people, but they can be anything -- cities, families, farms, days (time series analysis).

 
> sas intro
> ls
intro.log      intro.lst      intro.sas    oldclass.dat


SAS produces two output files, the log and the list file. If you have errors, there may be no lst file, and your error messages will appear on the log file. Look at it with less intro.log.

The process is iterative. If you do not like your output, edit the command file, the data file or both, and re-run. Once you are happy, print the output like this. Bring the log and list file to the quiz.


> lpr intro.lst  
> lpr intro.log  
> lpr intro.sas

Here is a picture of the process. It can be modified to suit a system capable of displaying multiple windows at the same time.

 

 

 

 

 

In the picture above, "laser" should be "lpr."