Chapter Contents

Previous

Next
%KEYDEF

%KEYDEF



Assigns a definition to or identifies the definition of a function key

Type: Macro statement
Restriction: Allowed in macro definitions or open code


Syntax
Details
Example
Sample %KEYDEF Statements

Syntax

%KEYDEF key-name<definition>;

key-name
is the name of any function key on your terminal, such as F1. The maximum length for key-name is the same as for the KEYDEF statement in the base SAS language. If you use only the key-name argument, SAS issues a message identifying the definition of that function key. If the name of a function key contains more than one word or if it contains special characters, then enclose the name in quotation marks.

The following examples illustrate using the %KEYDEF statement:

Operating Environment Information:   The names of function keys vary by operating environment and hardware. For details on the KEYS window, see the SAS documentation for your operating environment.  [cautionend]

definition
is the text (up to 80 characters long) that you want to assign to the function key. The definition can also be within single or double quotation marks.

If the definition is not in quotation marks, any macro invocations or macro variables are resolved, and the definition is converted to uppercase. However, a definition that is not in quotation marks cannot contain semicolons unless they are enclosed in a macro quoting function. If the definition is more than 80 characters long, it is truncated to 80 characters without a warning or error message.

If the definition is enclosed in double quotation marks, macro references or macro variable references are resolved. If the resolved definition is more than 80 characters long, it is truncated to 80 characters without a warning or error message.

If the definition is enclosed in single quotation marks, macro references or macro variables are not resolved until the function key is pressed. To circumvent the 80 character limit on definition, you can use a macro invocation or macro variable reference.

The value of definition is

command | ~text

command
is one or more windowing environment commands. When you press the function key, the assigned command or commands are submitted within the current window.

~text
is any text that you want to insert after the current cursor position. When you press the function key, the assigned text is inserted after the cursor position in any field of any window that accepts input. The tilde symbol does not become part of the inserted text.


Details

Use the %KEYDEF statement only in a SAS windowing environment session. Function key definitions you assign with %KEYDEF remain in effect for the duration of your current SAS session or until you change them again during the session. To save function key settings from one session to the next, use the KEYS window or place the %KEYDEF statement in an autoexec file.


Example

Example 1: Sample %KEYDEF Statements

In these examples the values f1 through f6 represent the names of function keys.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.