Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The main panel on the right side shows a glimpse into two of the three most important
windows: The Log window, top, which shows information regarding any job you submit
to SAS, including error messages. The bottom panel is the Editor, where you will enter
the program statements that control your program. By clicking the maximize button on
any window you increase it to full-size.
Maximize the editor window and type in the program given in the preceding introduction
(eliminating the explanatory comments that follow the arrows). After you finish typing,
your editor should look like the screen shown on the next page. Note that SAS will
colorize comments green as you type, and certain keywords will come up in blue.
(see screen picture on next page)
TO RUN YOUR PROGRAM:
You can press F8, or you can click on the running man icon on the top toolbar. If you
wish, you can highlight only a section of your program, then when you press F8 only
those lines are processed.
MOVING BETWEEN WINDOWS - You can move back and forth among the
windows. Either click on the Window item in the top toolbar and highlight the desired
window, or
Editor Press F5
Log Press F6
Output (text) Press F7
Graphs Click on the Results tab, bottom left, then doubleclick on the desired graph
SAVING YOUR PROGRAM
You can save your program by moving to the Editor window, then calling up FILE >
SAVE, and filling in the location and name of the file. It should be saved with the
extension .sas.
EXITING SAS
In the usual Windows way, just do FILE > EXIT. It will ask if you are sure you want to
quit. If you havent recently saved your program, it will ask if you wish to do so.
Some of the output will be sent to the Output window which you access using the F7 key.
The histogram will be sent to the Graphics window. You close the Graph by clicking the
close button. You get back to it by looking at the Results box on the left, and finding the
output marked with a graph icon.
Suppose that you were writing a report on the differences between cholesterols for men
and women. One of the things you might put into the report is the histogram. Try this:
Minimize SAS (do not exit it), and open a document in Word. Leave Word open, and
5
return to SASs graphics window with the histogram showing. Right-click on the
histogram, and choose EDIT > COPY. Now return to the Word document, and paste in
the histogram. Save your document frequently.
Try obtaining a scatterplot of Cholesterol versus Age, using
Proc Gplot;
Plot Chol*age=sex;
Run;
In the Plot statement, the Y variable goes to the left of the *, and the X variable to the
right. The optional =Sex part requests that separate symbols be used to plot the points for
men and women.