Thursday, December 21, 2006

Running SAS on Unix

The format of the command to run SAS is:

hsph% sas filename

SAS would print the log file in filename.log and the results in filename.lst.

Following is a sample sas program in unix is

options pagesize=59 ls=64;
libname new '.'; ** sets the library to the directory in which the program resides**
data ex;
infile '/usr2/users/student/mkaushik/la/tumor' TRUNCOVER;
/** reads the .txt file. Note the way file is referenced using backslash.**/

input id treat y;
proc print;
run;
proc genmod ;
class treat;
model y=treat/dist=binomial link=logit;

ESTIMATE 'thiopeta vs. Placebo' treat 1 -1 / e exp;
run;

This program can be written using text editors such as pico, emacs or vi. Alternatively, it can be written in notepad in windows and then transferred to UNIX account using WinSCP.

You can download tumor from here and transfer the file to your UNIX account.

No comments: