Chapter Contents


SAS Companion for UNIX Environments

Macro Statements

The arguments that can be entered with the following statements depend on the operating environment:

is analogous to the KEYDEF command. It enables you to define function keys. The %KEYDEF statement has the following syntax:

%KEYDEF keyname | 'keyname' <'definition'>;

If the definition is omitted, a message is printed to the log showing the current definition of the key; otherwise, the key's definition is changed to whatever you specify.

Key names vary from terminal to terminal. You can define any key listed in the KEYS window, provided that it is not reserved by UNIX. You must enclose in quotes any key name that is hyphenated or contains a space, such as CTRL A or SHFT F1. For example, to assign the RECALL command to the CTRL A key sequence, submit the following statement:

%keydef 'ctrl A' 'recall';

executes UNIX commands. It is similar to the X statement described in Executing Operating System Commands from Your SAS Session. The %SYSEXEC statement enables you to execute operating environment commands immediately and, if necessary, determine whether they executed successfully by examining the value of the automatic macro variable SYSRC. You can use the %SYSEXEC statement inside a macro or in open code. The form of the %SYSEXEC statement is as follows, where command can be any UNIX command:

%SYSEXEC <command>;

For example, the following code writes the status of the default printer to your UNIX shell:

%sysexec lpstat;

Entering %SYSEXEC without a UNIX command starts a new shell, except under the X Interface to the SAS System. See Executing Operating System Commands from Your SAS Session for details.

Chapter Contents



Top of Page

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