DISPLAY Statement

Displays a window that is created with the WINDOW statement.
Valid in: DATA step
Category: Window Display
Type: Executable

Syntax

Arguments

window< .group>
names the window and group of fields to be displayed. This field is preceded by a period (.).
Tip:If the window has more than one group of fields, give the complete window.group specification. If a window contains a single unnamed group, use only window.
NOINPUT
specifies that you cannot input values into fields that are displayed in the window.
Default:If you omit NOINPUT, you can input values into unprotected fields that are displayed in the window.
Restriction:If you use NOINPUT in all DISPLAY statements in a DATA step, you must include a STOP statement to stop processing the DATA step.
Tip:The NOINPUT option is useful when you want to allow values to be entered into a window at some times but not others. For example, you can display a window once for entering values and a second time for verifying them.
BLANK
clears the window.
Tip:Use the BLANK option when you want to display different groups of fields in a window and you do not want text from the previous group to appear in the current display.
BELL
produces an audible alarm, beep, or bell sound when the window is displayed if your personal computer is equipped with a speaker device that provides sound.
DELETE
deletes the display of the window after processing passes from the DISPLAY statement on which the option appears.

Details

You must create a window in the same DATA step that you use to display it. Once you display a window, the window remains visible until you display another window over it or until the end of the DATA step. When you display a window that contains fields where you enter values, either enter a value or press ENTER at each unprotected field to cause SAS to proceed to the next display. You cannot skip any fields.
While a window is being displayed, use commands and function keys to view other windows, to change the size of the current window, and so on.
A DATA step that contains a DISPLAY statement continues execution until the last observation that is read by a SET, MERGE, UPDATE, MODIFY, or INPUT statement has been processed or until a STOP or ABORT statement is executed. You can also issue the END command on the command line of the window to stop the execution of the DATA step.
You must create a window before you can display it. See the WINDOW Statement for a description of how to create windows. A window that is displayed with the DISPLAY statement does not become part of the SAS log or output file.

Example

This DATA step creates and displays a window named START. The START window fills the entire screen. Both lines of text are centered.
data _null_;
   window start
          #5 @28 'WELCOME TO THE SAS SYSTEM'
          #12 @30 'PRESS ENTER TO CONTINUE';
   display start;
   stop;
run;
Although the START window in this example does not require you to input any values, you must press ENTER to cause the execution to proceed to the STOP statement. If you omit the STOP statement, the DATA step executes endlessly unless you enter END on the command line of the window.
Note: Because this DATA step does not read any observations, SAS cannot detect an end-of-file to cause DATA step execution to cease. If you add the NOINPUT option to the DISPLAY statement, the window displays quickly and is removed.

See Also

Statements: