SAS Display Manager Environment

The SAS Display Manager provides a self contained interactive environment within which you can enter and execute SAS code. Pull down menus are available to facilitate accessing of data sets and execution of procedures; e.g., Interactive Data Analysis and Design of Experiments.

This chapter contains the following sections:


Starting the SAS Display Manager System (DMS)

This environment is available in all windows style implementations of the SAS System at Virginia Tech. In the Macintosh and Microsoft Windows environments, you can start the SAS Display Manager by double clicking on the SAS icon.

If you are logging onto a UNIX system using an X server, you can use the capabilities of the X Windows System and your window manager to facilitate use of the SAS System. As typical of X applications, you must first grant permission for the UNIX system to display on your server and then define the DISPLAY environmental variable on the X client to specify the X server where SAS will direct its output displays. Then, to start the Display Manager, simply enter the command: sas

If you are using a Macintosh, Microsoft Windows, or an X server with UNIX, you can use the associated mouse to move the cursor on the screen and make selections from the available menus.


Using the SAS DMS Windows

The Display Manager provides full screen editing capabilities and an interactive interface to facilitate the writing and execution of SAS programs. Once you have started the Display Manager, you can enter your code into the program editor and then enter (or select from the Local menu) the command submit to execute this code. If you are using a Windows display manager, you can use the mouse, menus and other features of the manager (e.g., copy, cut, and paste) to edit text within the Program Editor Window; otherwise you can enter commands on the command line or in the prefix area to perform these functions.

If you already saved the SAS program as a file, you can use the include command to copy the contents of the file into the Program editor window. Alternatively, you can use Assist (under the Globals menu) to create and execute procedures against SAS data sets without having to enter SAS code.

Several windows are supported by the Display Manager:

Program Editor (PGM) Window
is used to enter SAS code which is to be submitted for execution.

LOG Window
displays the SAS LOG. The SAS LOG contains a copy of your SAS program and all diagnostic messages.

Output Window
displays the results of the executed SAS code.

DMS commands are executed by typing them on the command line of the appropriate window and pressing the <Enter> key or by making selections from menus. Several of the most commonly used commands are assigned to function (F) keys so that they may be executed by a single key stroke. The KEYS command, issued from the command line of any window, may be used to view a listing of the commands currently assigned to each key for that window (The F Key definitions in the PC implementation differ significantly from those on the mainframe.). Enter the command END on the command line of the KEYS Window to return to the prior screen.

Use of interactive SAS provides the following advantages:

  1. A program may been entered one step at a time. Any syntax errors may thus be readily identified and corrected for each step.

  2. The output of each step may be examined to identify obvious logic errors. Tracking a program step by step helps to ensure that such errors will not be lost in the final summary.

  3. The results of a step can be used to plan the approach for the the next step. For example, if one were trying to fit a line to a set of data, an X-Y plot may suggest that linear regression is inappropriate and that another model should be considered.

  4. A program may be tested interactively using a small dataset and then saved by using the RECALL and FILE 'filespec' commands.

  5. An existing program may be brought into the Display Manager by the INCLUDE command; an "INCLUDEd" program may be modified prior to being submitted for execution.

Commonly Used DMS Commands

Here is a list of some commands commonly invoked from the Display Manager command line (see Initial SAS Exercises for instructions for displaying the command line if it is not already present):

bye
exit from SAS

submit
execute the SAS code in the current Program Editor Window

end
quit from the current window

help
access help system

undo
"undo" prior change

recall
retrieve previously submitted SAS code

clear
clear contents of current window

zoom
enlarge current window to full screen

file 'filespec'
write the current contents of the window to the file 'filespec'

include 'filespec'
read the contents of 'filespec' into the Program Editor Window

top
move to top of file

bottom
move to bottom of file

down #
move down # lines

up #
move up # lines

forward
move down one screen

backward
move up one screen

right
move screen viewing window to the right

left
move screen viewing window to the left

output
move to the output window

log
move to the log window which contains program annotated with diagnostic messages.

program
move to the program editor window.

pmenu
display the pmenu system. Use the tab key to move between menus and the Enter Key to make selections.

X
temporary exit to operating system shell environment

keys
display function key definitions

To turn on or turn off insert mode, try using the Ins or Insert key on your keyboard. If this key fails to function as desired, try using the Ctrl-X (that is press the Ctrl or Control Key, and, while it is depressed, press the "x" key) key combination.


SAS DMS Prefix Area Commands

If you are using SAS the DOS version for PCs, you will observe a prefix area (===== or numbers) along the left margin of the Program Editor Window. This region of the screen is used for entering "prefix" commands to manipulate lines within the display.

If you are using a Windows based environment and no prefix area is displayed, you can enable this capability by entering the command:   num on

Likewise you can turn off this feature by entering: num off

The Display Manager prefix area editing capabilities are similar to those found in some text editors, for example uni-Xedit on VTAIX or Kedit in MS/DOS; however, several of the functions have different names. For example, the Prefix Area Commands P (Preceding), F (Following), and A (Addlines) are replaced by the SAS Program Editor commands B (Before), A (After), and I (Insert). The PgUp and PgDn are used to move backward and forward in a file. Prefix area commands may be entered in upper, lower, or mixed case.

Some of the most commonly used prefix area commands include:

ia
insert a line after this line

ib
insert a line before (in front of) this line

d#
delete # lines

m#
move # lines

c#
copy # lines

r#
repeat (duplicate) line # times

a
after, e.g., place copied or moved lines after this line

b
before, e.g., place copied or moved lines before (in front of) this line

User Services
Virginia Tech Computing Center