Chapter Contents


SAS Companion for UNIX Environments

Configuring the SAS System for Host Editor Support

The SAS System supports the use of a host text editor with the Motif interface, so you can use an editor such as vi or EMACS with your SAS session. There is no host editor set as the default host editor, so you must specify one to use this feature. Host editor support requires the use of the motifxsassm client. (See Using the SAS Session Manager (motifxsassm) for more information.)

To use your host text editor with SAS, use the EDITCMD system option to specify the command required to invoke your editor. Then, use the HOSTEDIT command to invoke the editor as needed. The HOSTEDIT command passes data from a SAS window to the host editor. When you save in the host editor, the data is copied back into the SAS window if the window is writable. HED is an alias for the HOSTEDIT command. See EDITCMD and HOSTEDIT for more information.

When you issue the HOSTEDIT command from a SAS text editor window, the contents of the buffer for that window are written to a temporary file in the directory specified by the SASWORK option. A command invoking the specified host editor is passed to the SAS Session Manager. The session manager issues the command to the operating environment to invoke the editor for the temporary file.

The X display used with the HOSTEDIT command is the same one used with your SAS session.

The EDITCMD system option specifies the command that is issued to the operating environment. If you are using a terminal-based editor, such as vi, you must specify a command that runs the editor inside a terminal emulator window.

You can define the EDITCMD option using the SASV8_OPTIONS environment variable as part of a configuration file or on the command line to make the definition available automatically to the SAS System. The option must be specified as a quoted string. You can use either single or double quotes. You can change the value for the EDITCMD option during a SAS session by issuing an OPTIONS statement.

Text attributes, such as color and highlighting, are not transferred between a host editor window and a SAS text editor window. Issue the HEATTR ON command to display a dialog box that will warn you if you are editing text with highlighting and color attributes that will be removed by the host editor. This dialog box prompts you to continue or abort the HOSTEDIT command. Specify HEATTR OFF to suppress this dialog box.

After you return to the SAS text editor window, you can issue the UNDO command to undo all of the changes that you made with your host editor. You must issue the UNDO command a second time to return to the state of the window before the HOSTEDIT command was issued. If you issue the HOSTEDIT command in a read-only window, you can save your editing changes to an external file, but the SAS text editor window remains unchanged.

Some systems have an X-based editor installed that is called xedit. If you want to use xedit with the HOSTEDIT command, you can invoke SAS with the following command:

sas -editcmd '/usr/local/bin/xedit'

The vi editor is a terminal-based editor that requires a terminal window. The xterm client's -e option runs a program when the xterm client is invoked. To use the EDITCMD option to display an xterm client in conjunction with vi, invoke SAS as follows:

sas -editcmd '/usr/bin/X11/xterm -e /usr/bin/vi'

Chapter Contents



Top of Page

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