This page was adapted from a page created by Oliver Schabenberger. We thank Professor Schabenberger for permission to adapt and distribute this page via our web site.
SAS is a multi-platform software system. Although the core language and commands are identical on all platforms, the user interfaces can vary considerably depending on whether you run SAS on a Windows, Unix, mainframe, or other platform. The SAS graphical user interface (GUI) consists of three windows, called the LOG, OUT, and PROGRAM EDITOR window. When you first install and start SAS, the OUT window is overlayed by the other windows. See the next section for how to change window size and location. The PROGRAM EDITOR contains the SAS programming statements and data that you enter. Upon execution of parts or all of the contents of the PROGRAM EDITOR, SAS compiles your program and writes the results of execution to the LOG window. If the program produces output, it will be written to the OUT window which will become the active window upon completion of the program.
1.2.Changing size and color of the windows
The default color of white for the three windows is not a good choice. Novice users are likely to get confused which window is active. It is a good idea to change the colors of the windows. For example, to change the background and text color of the PROGRAM EDITOR, make this the active window. Then move the cursor to the box on the top left of the SAS GUI and enter
in the PROGRAM EDITOR and execute the program (see 1.3).
1.3.Executing a program
A program is part or all of the PROGRAM EDITOR that consists of executable statements and/or data. There are two ways to execute a program.
a) Highlight the section you wish to execute
with the mouse or Arrow keys (while holding down the Shift key). Then submit the
b) Simply submit the contents of the PROGRAM EDITOR (PROG).
To submit you can either
a) hit the speed button in the speed bar (the little runny guy)
b) Choose Locals-Submit from the menu
c) hit the F8 key
If you submit the entire contents of the PROG window without selecting part or all of the program, SAS will delete the code from the PROG window. Don't be alarmed. You can get it back after execution by either hitting F4 or selecting Locals-Recall Text from the menu. Because I do not care for this extra step and oftentimes one works on programs in small sections, I prefer to highlight before submission.
With the exception of the PROG window that is automatically cleared when submitted in its entirety, the other windows accumulate contents. It is recommended to clear the windows frequently. Especially the contents of the OUT window is often saved or printed at the end of a session. It is a nuisance if this window contains all previously generated output from incomplete or erroneous runs. To clear a window you select the window (make it active) and
a) select Edit-Clear Text from the menu
b) hit Ctrl-E
I prefer to automate the task of clearing the
LOG and OUT window prior to a new run by assigning a short key. To do this hit F9 to bring
up the window containing the key assignments.
Select a key (but do not override F4, F8, or other keys that have important commands assigned to them). Then enter
out; clear; log; clear; prg;
and hit F3 to close the window. Assume you assigned the string to the Shift-F2 key. When you hit Shift-F2 the OUT window will be cleared, the LOG window will be cleared, and then the PROG window will become active again. You can also assign your own version of the submit command to another key. For example
out; clear; log; clear; prg; zoom off; submit;
will clear the OUT and LOG windows, shrink the PROG window and submit the (highlighted) contents of the PROG window. This ensures that the contents of the LOG and OUT window pertain only to the most recent program execution.When making changes to the KEYS window that you wish to be active in subsequent SAS sessions, select Options-Save Settings Now from the menu.
1.5.Saving your work
You can of course save the contents of any of the three main windows by selecting File-Save or File-Save As.. from the menu. This does not seem to warrant any comment. However, much damage can be done by not carefully observing which window is being saved. The Save command always applies to the currently active window. When running a program that produces output, the OUT window will automatically become active. When selecting File-Save As.. immediately after execution, SAS will attempt to save the contents of the OUT window, while the user may be under the impression that the contents of the PROG window are being saved. Much labor has been destroyed by overwriting files containing SAS programs with contents of LOG or OUT windows.
The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.