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.
Caution: Even if you program contains syntax or runtime errors and produces output, the OUT window will be maximized at the end of the run, hiding the LOG window. After each execution of SAS statements, you should browse the LOG window for errors. Only if there are no errors should the contents of the OUT window be trusted.
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
color background red color text white to display the contents of the program editor in white text on red background. This process is relatively tedious, if done for all windows. SAS comes equipped with a little macro that sets the colors of all windows to the nicely designed colors of the earlier SAS 6.08 release. To do this enter
in the PROGRAM EDITOR and execute the program (see 1.3).
To change the size of the windows, move and resize according to taste. I prefer to set up the windows so that all three are visible at all times. Once you have changed the color and placement of the windows, choose View-Save Atrtributes from the menu to permanently save the settings for subsequent SAS sessions.
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 highlighted section. 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.
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.