SAS is currently installed only on one workstation, "hilbert". If you have logged into another machine, you can type ssh hilbert to start a session on hilbert.
Help Pages
Web-based help is available from sas.com.
data tires;
input hardness tensile abrsloss @@;
datalines;
45 162 372 83 161 97 55 233 206 88 119 64
61 232 175 59 161 249 66 231 154 71 151 219
71 231 136 80 165 186 71 237 112 82 151 155
81 224 55 89 128 114 86 219 45 51 161 341
53 203 221 59 146 340 60 189 166 65 148 283
64 210 164 74 144 267 68 210 113 81 134 215
79 196 82 86 127 148 81 180 32 56 200 228
68 173 196 75 188 128
;
proc reg data=tires;
model abrsloss = hardness tensile;
run;
proc plot;
plot hardness * abrsloss;
run;
Big data files are not included as part of a program, but are read in
with an "infile" statement. To do the same analysis using infile,
create the data file first with only three numbers on each line (see
emacs session. Save it as "tires.dat".
Then the following commands will read it in and do the regression
in SAS. Type into
Program Editor:
data tires; infile "tires.dat"; ** you may need the complete path here; input hardness tensile abrsloss; proc reg data=tires; model abrsloss = hardness tensile; run; proc plot; plot hardness * abrsloss; run;To get output, you have to submit the job. You can submit by picking Submit on the Run menu of the Program Editor window or click on the running figure icon in the ToolBox window. Usually when I submit a job, I switch to the Log window and look for red type to catch any errors, then to the Output window to see the analysis, then back to the Program Editor to fix any errors. When correcting mistakes, I remove text in the Log and Output windows (otherwise it gets added on to the end of the current content). Then in the Program Editor window I click on Run menu and Recall Text to get back the last batch of commands. When editing, if you want to delete a line of code, go left into the line numbers and type "d" and enter. To insert a line after the current line, type "i enter" in the numbers. You can delete k lines or insert k lines by typing the d or i and the number (then return).
Another option is to have an emacs window open containing the SAS code. Modify the code in the window, then drag the mouse over it (using left mouse button) and click in the SAS Program Editor window (center mouse button) to insert the text. If the command file ends with the .sas extension, then emacs may put you into ESS (Emacs Speaks Statistics) which also allows you to submit jobs. For more details on running within emacs see Emacs Speaks Statistics, ESS.
Tip for clearing output and log windows:
Don't expect your program to work right the first time. I usually
forget a ";" or have a typo, if not some larger problem, so I often
choose "Recall last submitted", edit that file and re-run it. A
problem is that the Log and Output windows do not clear unless you
make them clear, so I include this line to clear them:
dm "out;clear;log;clear;";It tells the display manager (dm) to go to output, clear that window, then to log, and clear that window. I also set page length and line length with these options:
options ls = 78 ps = 66;
ssh hilbert sas BATCH myjob.sas more myjob.log(You will have to log in to hilbert after the ssh command.)
Version 9 of SAS software has very nice web-based help. Here are some links to specific procedures:
Other Stat package demos for unix packages:
Back to MSU Math Department Home Page
Author: Jim Robison-Cox