WINDOW Statement

WINDOW <CLOSE=window-name> <*>window-options <*>GROUP=group-name field-specs <*>…GROUP=group-name field-specs ;

The WINDOW statement defines and opens a window on the display and can include a number of fields. The DISPLAY statement actually writes values to the window. The following fields can be specified in the WINDOW statement:

window-name

specifies a name 1 to 8 characters long for the window. This name is displayed in the upper left border of the window.

CLOSE=window-name

closes the window.

window-options

control the size, position, and other attributes of the window. The attributes can also be changed interactively with window commands such as WGROW, WDEF, WSHRINK, and COLOR. A description of the window options follows.

GROUP=group-name

starts a repeating sequence of groups of fields defined for the window. The group-name specification is a name 1 to 8 characters long used to identify a group of fields in a later DISPLAY statement.

field-specs

are a sequence of field specifications made up of positionals, field operands, formats, and options. These are described in the next section.

The following window options can be specified in the WINDOW statement:

CMNDLINE=name

specifies the name of a variable in which the command line entered by the user will be stored.

COLOR=operand

specifies the background color for the window. The operand is either a quoted character literal, a name, or an operand. The valid values are WHITE, BLACK, GREEN, MAGENTA, RED, YELLOW, CYAN, GRAY, and BLUE. The default value is BLACK.

COLUMNS=operand

specifies the starting number of columns for the window. The operand is either a literal number, a variable name, or an expression in parentheses. The default value is 78 columns.

ICOLUMN=operand

specifies the initial starting column position of the window on the display. The operand is either a literal number or a variable name. The default value is column 1.

IROW=operand

specifies the initial starting row position of the window on the display. The operand is either a literal number or a variable name. The default value is row 1.

MSGLINE=operand

specifies the message to be displayed on the standard message line when the window is made active. The operand is almost always the name of a variable, but a character literal can be used.

ROWS=operand

determines the starting number of rows of the window. The operand is either a literal number, the name of a variable that contains the number, or an expression in parentheses that yields the number. The default value is 23 rows.

Both the WINDOW and DISPLAY statements accept field specifications, which have the following general form:

<positionals> field-operand <format> <field-options> ;

The arguments to these statements are as follows:

positionals

are directives determining the position on the screen to begin the field. There are four kinds of positionals; any number of positionals are accepted for each field operand.

# operand

specifies the row position; that is, it moves the current position to column 1 of the specified line. The operand is either a number, a name, or an expression in parentheses.

/

specifies that the current position move to column 1 of the next row.

@ operand

specifies the column position. The operand is either a number, a name, or an expression in parentheses. The @ directive should come after the # position if # is specified.

+ operand

specifies a skip of columns. The operand is either a number, a name, or an expression in parentheses.

field-operand

is a character literal in quotes or the name of a variable that specifies what is to go in the field.

format

is the format used for display, the value, and the informat applied to entered values. If no format is specified, then the standard numeric or character format is used.

field-options

specify the attributes of the field as follows:

PROTECT=YES
P=YES

specifies that the field is protected; that is, you cannot enter values in the field. If the field operand is a literal, it is already protected.

COLOR=operand

specifies the color of the field. The operand is a literal character value in quotes, a variable name, or an expression in parentheses. The colors available are WHITE, BLACK, GREEN, MAGENTA, RED, YELLOW, CYAN, GRAY, and BLUE. Note that the color specification is different from that of the corresponding DATA step value because it is an operand rather than a name without quotes. The default value is BLUE.