1Starting SASTo start SAS
1. Click on the SAS ICON on the desktop,

or
2. Click START, ALL PROGRAMS, SAS, and the SAS ICON
The result looks like this:2
Click on Close on the Getting Started With SAS dialog box. If someone has turned off
Getting Started With SAS, you will not have to do this). The result isFour Windows
Shown are parts of two of the four windows that are important in this class:the Editor window and

the Log window.

The other important windows are the Output window and the Results window. Notice onthe bottom tool bar the words Results, Output, Log, and Editor. Clicking one of thesechanges the Window that is active. Also notice that each of Output, Log, and Editor says
untitled. This is because the contents of these windows have not been saved.

3The Editor Window
The Editor window is used to type SAS programs. It works like a word processor. The
following shows the Editor Window after it has been maximized and after I typed aprogram into it. This is the program we covered in class.

Notice that Notice the use of color:Dark blue and blue for SAS keywords

Green for format elements

Black highlighted in yellow for data and black for code that is not keywords.

Red will sometimes appear. Usually this means you have made a mistake.

To save the program use one of the following two procedures:

4
1. Click on File on the toolbar and then on Save or Save As. This opens a standard
Windows dialog box for saving the files.
2. Click on the disc icon. This opens a standard Windows dialog box for saving thefiles, but if you are saving a file that has already been changed, it just saves thefile.
Here is what SAS looks like after the file is saved

Note disc.sas (the file name under which I save the program) on the bottom toolbar.
Suppose I make a change to the text in the Editor window. For example taking out theDOUBLE in PROC PRINT DOUBLE. Here is what SAS looks like:5

Notice the asterisk modifying disc.sas. This signifies that a change has been made to thefile and the file has not been saved since the change was made. If I save the file, theasterisk disappears.
Running the Program
There are two ways to run the program.
1. Click on the running icon on the toolbar.
2. Press F3.
Here is what you see:

6This is part of the output, but before looking at the output you should ALWAYS switch
to the Log window to check whether the program ran correctly. There are four ways to dothis:
1. Click Log at the bottom of the screen. (This does not work if the Log
window has been closed).
2. Click Window and then Log.
3. Click View and then Log.
4. Press F6.
Here is what you see:

7

Maximizing SAS, maximizing the log window, and using the slide at the right to go tothe top, we can see the whole Log window:

8

Notice that there are NOTES but no WARNINGs or ERRORs. This means that yourprogram has run correctly. By contrast, here is a Log window for a program on which I
deliberately made a mistake by changing PROC PRINT to PROC RINT:

9

Note the ERROR printed in red. All warnings and errors should be cleared up before
looking at the Output window because SAS often produces some results even though
it issues a warning or has encountered an error.
You can save the contents of the Log window by using the procedure used to save theEditor window, though typically there is no reason to save the contents of the Logwindow.
Once you are through looking at the Log window you can clear it by using one of thefollowing two procedures (make sure the Log window is active):
1. Press Ctrl and E simultaneously
2. Click Edit and Clear All.
It is a good idea to do this. Otherwise in a session in which you run several programs, you
can lose track of which part of the Log window goes with which program10The Output and Results Windows
Once you have a Log window without errors or warnings, you can open the Output
Window by using one of the following four procedures:
1. Clicking Output at the bottom of the screen. (This does not work if theOutput window has been closed).
2. Clicking Window and then Output.
3. Clicking View and then Output.
4. Pressing F7.
Here is the Output window, maximized with the cursor at the top of the window:

11
Notice also the Results Window at the left. You can use this to move around in theOutput window. If you click on a plus box, it will show you all of the available results ina section of the Output Window. Clicking on the icon for the results will move the cursor
to that part of the Output Window.
You can save the Output window by using the procedure used to save the Editor window.
Once you are through looking at the Output window you can clear it by using one of thetwo following procedures. With the Output window open:
1. Press Ctrl and E simultaneously
2. Click Edit and Clear All.
It is a good idea to do this. Otherwise in a session in which you run several programs, you
can lose track of which part of the Output window goes with which program.
The Editor Window Again
You can return to the Editor window by using one of the following four procedures:
1. Clicking Editor (or the file name, whichever is displayed) at thebottom of the screen. (This does not work if the Log window has beenclosed).
2. Clicking Window and then Editor.
3. Clicking View and then Editor.
4. Pressing F5With the Editor Widow open, you can clear the Editor Window by using one of thefollowing two procedures:
1. Pressing Ctrl and E simultaneously.
2. Clicking Edit and Clear All.

12If you inadvertently clear and Editor Window while you still need the program, pressing
F4 will bring the contents from memory into the Editor window.
Printing
You can print the contents of any of the Editor, Log, or Output Windows by using one of
the following two procedures:
1. Press the printer icon.
2. Press file and then print.
You can print a selected section of the Output Window by using the Results window tolocate the section you want to print, right clicking on the section, and clicking the printericon.
KeysPressing F9 lists the key stroke shortcuts that can be used in SAS.
Try SAS OutUse the program file (disc.sas) presented in class to try SAS out.