Previous Page | Next Page

Working in the SAS Windowing Environment

Configuring SAS for Host Editor Support in UNIX Environments


Requirements for Using a Host Editor

SAS 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 The SAS Session Manager (motifxsassm) in UNIX for more information.)


Invoking and Using Your Host Editor


How to Open and Use the Host Editor

To use your host text editor with SAS, complete the following steps:

  1. Specify the command required to invoke your editor with the EDITCMD system option.

  2. Invoke the editor as needed with the HOSTEDIT command.

The HOSTEDIT command passes data from a SAS window to the host editor. When you save data in the host editor, the data is copied back into the SAS window if the window can be written to.

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.

See EDITCMD System Option: UNIX and HOSTEDIT Command: UNIX for more information.


Example 1: Invoking SAS to Use xedit with the HOSTEDIT Command

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'


Example 2: Invoking SAS to Use vi

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'


Troubleshooting the Transfer of Text Attributes

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.

Previous Page | Next Page | Top of Page