Chapter Contents

Previous

Next
SAS Companion for the Microsoft Windows Environment

Using the Enhanced Editor

The Enhanced Editor is an ASCII editor that uses visual aides to help you write and debug your SAS programs.

Select one of the following links for more information:


Enhanced Editor Features

The Enhanced Editor includes many of the features from the Program Editor in addition to the following:


Opening Files

To open a new file, select

View
[arrow]
Enhanced Editor

Alternatively, you can open new files using the New toolbar button, the File menu, or the WEDIT command. For more infomation about the WEDIT command, see WEDIT.

To open an existing file, make an existing Enhanced Editor window the active window and do the following:

To append a file to the bottom of an opened file:


Saving Files

An asterisk ( * ) that appears in an Enhanced Editor window title bar indicates that the editor contains text that has not been saved to disk. Enhanced Editor windows that display 'Untitledx' in the title bar are new files that have never been saved. The x indicates a window number.

To save the contents of the Enhanced Editor window, click on the Save toolbar button (the diskette). If the file is to be saved for the first time, the Save As dialog box will open for you to name the file and folder.

To save a file with a new name, select

File
[arrow]
Save As
Then, enter the filename and folder in the Save As dialog box.


Checking for Coding Errors

By color coding program components, the Enhanced Editor can help you check for errors such as misspelled keywords and unmatched quotes and comments. For information on defining colors for program components, see Setting Appearance Options.

For example, if you define the undefinded keyword foreground color to black, the undefined keyword background color to gray, and the keyword color to blue, the Enhanced Editor would change a keyword to blue when it is entered correctly. As the first word in a statement is a SAS keyword, you could recognize misspelled keywords instantly by the black text on a gray background at the beginning of a line.

In Filename Statement with a Missing Quotation Mark, you can see that unmatched quotation marks for strings are easily spotted as the text remains the same color until the string is closed with a matching quotation mark. In this example, all text after the open quotation mark is red. The comments following the filename statement are red also as the string was never closed. Looking for Errors in the Enhanced Editor shows that once the string is closed, the string remains red and the comments have been defined as green.

As with strings, all text that follows the open comment symbol /* remains the same color until the Enhanced Editor recognizes an ending comment symbol */.

To check for unmatched parenthesis or brackets, place the cursor before a parenthesis or bracket and press Ctrl + ]. If one is not found, the cursor does not move.

Filename Statement with a Missing Quotation Mark

[IMAGE]

Looking for Errors in the Enhanced Editor

[IMAGE]


Using the Enhanced Editor Window

This section explains the many functions available to you in the Enhanced Editor window.


Overview of the Enhanced Editor Window

When the Enhanced Editor opens a new file, the title bar of the Enhanced Editor window contains the Enhanced Editor icon (as shown in Enhanced Editor Icon) and the text 'Untitledx', where x is a window number.

Enhanced Editor Icon

[IMAGE]

Once you start entering text, the title bar displays an asterisk ( * ) which indicates that changes have been made to the file and the changes have not been saved to disk. Once you save the file, the file name displays in the title bar and the asterisk disappears until you start entering additional text.

The margin on the left side of the Enhanced Editor window is used to select lines of text, expand and collapse code sections, and display line numbers, code section brackets, and bookmarks.

Moving the Cursor

The Enhanced Editor has numerous key sequences for moving the cursor, as shown in Key Sequences for Moving the Cursor.

To go to a specific line, use the Go To Line dialog box:

  1. Enter the key sequence Ctrl + G.

  2. Enter the line number.

  3. Click on [OK].

By default, when you click the mouse button past the end of a line, the cursor is placed after the last character in a line.

To enable the Enhanced Editor for placing the cursor past the end of a line:

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor...
    [arrow]
    General

  2. Select the Allow cursor movement past end of line check box.

  3. Click on [OK].

Key Sequences for Moving the Cursor
Use Key Sequence... To Move the Cursor....
Up arrow up one line
Down arrow down one line
Left arrow left one character
Right arrow right one character
Page Down down a page
Page Up up a page
Home to the beginning of the current line
Ctrl + Home to the beginning of the document
End to the end of the current line
Ctrl + End to the end of the document
Ctrl + up arrow towards the top of the file while scrolling up
Ctrl + down arrow towards the bottom of the file while scrolling down
Ctrl + right arrow to the start of the next word
Ctrl + left arrow to the start of the previous word
Ctrl + ] to the matching parenthesis or bracket
Ctrl + G to a specific line number
Alt + up arrow to the first visible line
Alt + down arrow to the last visible line
Alt + up arrow to the first visible line
Alt + right arrow to the next case change or word boundary
Alt + left arrow to the previous case change or word boundary
Shift + Tab backwards to the previous tab stop


Selecting and Editing Text

To select one or more lines of text using the margin:

  1. Click and hold down the left mouse button in the margin on the first line of text you want to select.

  2. Still holding down the left mouse button, drag the cursor within the margin to the last line you want to select.

  3. Release the left mouse button.

Selected text is marked in reverse video.

You can also select single or multiple characters, or whole lines of text when you:

  1. Click and hold down the left mouse button before the first character you want to select.

  2. Still holding down the left mouse button, drag the cursor to the last character you want to select.

  3. Release the left mouse button.

Keyboard shortcuts are also available to select text. To extend a selection in a particular direction, press the Shift key and then a directional arrow. Pressing Shift + left arrow or right arrow will select one character at a time. Pressing Shift + up arrow or down arrow will select one line at a time. For a complete list of selection keyboard shortcuts, see the Selection category in Keyboard Shortcuts within the Enhanced Editor.

To unmark selected text, press any directional key.

To copy selected text, press Ctrl + C or select

Edit
[arrow]
Copy

To cut selected text, press Ctrl + X or select

Edit
[arrow]
Cut

To paste from the clipboard, press Ctrl + V or select

Edit
[arrow]
Paste

To move selected text:

  1. Place the mouse cursor over the selected text.

  2. Click and hold down the left mouse button. The cursor displays a vertical line.

  3. Still holding down the left mouse mouse button, drag the selected text and place the vertical line to the position where you want to place the text.

  4. Release the left mouse button.

Copying or cutting text places the text in the Windows clipboard. If you select text and then delete the text using the Delete key, the deleted text is not placed in the clipboard.

Text from the clipboard is pasted to the area you indicate. If there is already an area of selected text within the target window, the selected text is replaced with contents of the clipboard.

Note:   In addition to using commands from the Edit menu, editing commands are available from the pop-up menu when you click the right mouse button in the Enhanced Editor window.  [cautionend]

Dragging and Dropping Text

To move or copy text using drag and drop:

  1. Select the text to move or copy and hold down the left mouse button.

  2. To move the text, drag the text to the desired location and release the left mouse button. To copy the text, press the Ctrl key, drag the text to the desired location, and release the left mouse button.

To disable drag and drop editing::

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor...
    [arrow]
    General

  2. Uncheck the Drag and drop text editing check box and click on [OK].


Finding and Replacing Text

To find text:

  1. Open the Find dialog box by selecting

    Edit
    [arrow]
    Find...

  2. Complete the following:
    Find text:
    Enter a text string to find.

    Find in:
    Click in this list box and specify whether to search in the code only, in the comments only, or in both the code and comments.

    Direction
    Up specifies to search from the cursor position towards the beginning of the file. Down specifies to search from the cursor position towards the bottom of the file.

    Match whole word only
    Select to specify that a match of the text must be a whole word and not part of a word.

    Match case
    Select to specify that upper and lower case characters must match exactly.

    Regular expression search
    Select to specify that the text string includes a regular expression. A regular expression is used to search for a string or substring using special characters as wildcards. For a description of special characters used in regular expressions, click on [Help] in the Find dialog box.

  3. Click on [Find Next].

To find and replace text

  1. To search only within a subset of text, select the text.

  2. Open the Replace dialog box by selecting

    Edit
    [arrow]
    Replace...

  3. Complete the following:
    Find text:
    Enter a text string to find and replace.

    Replace with:
    Enter the replacement string.

    Find in:
    Click in this list box and specify whether to search in the code only, in the comments only, or in both the code and comments.

    Direction
    Up specifies to search from the cursor position towards the beginning of the file. Down specifies to search from the cursor position towards the bottom of the file.

    Match whole word only
    Select to specify that any match of the text must be a whole word and not part of a word.

    Match case
    Select to specify that upper and lower case characters must match exactly.

    Regular expressions
    Select to specify that the text string includes a regular expression. A regular expression is used to search for a string or substring using special characters as wildcards. For a description of special characters used in regular expressions, open the Find dialog box from the Edit menu and click on [Help].

  4. Click on [Find Next].

  5. If the text is found, click on one of the following:


Using Automatic Indenting and Tabs

When you press the Enter key, you automatically indent the next line by the amount of space the current line is indented. If you prefer not to use automatic indentation:

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor
    [arrow]
    General

  2. In the Indentation box, select the None radio button.

In addition to automatic indenting, you can indent using the tab key. Pressing the Tab key moves the cursor and any text to the right of the cursor by the amount of space specified in the Tab size: field of the Enhanced Editor Options dialog box. If you want to insert spaces instead of tab characters when you press the Tab key, select the Insert spaces for tabs check box.

Note:   Changing the tab size will modify tab settings to the new value in all Enhanced Editor windows.  [cautionend]

Bookmarking Lines

When you bookmark a line, you create a line marker that is used to easily access that line. A vertical rectangle in the margin indicates that the line is bookmarked. Keyboard Shortcuts for Bookmarking Lines shows the keyboard shortcuts you can use with bookmarking.

Keyboard Shortcuts for Bookmarking Lines
To... Press...
Bookmark a line Crtl + F2 on an unmarked line
Unmark a line Ctrl + F2 on a marked line
Go to the next bookmark F2
Go to the previous bookmark Shift + F2


Using Abbreviations

You can define a character string which when entered and followed by the Tab key or the Enter key will expand to a longer character string. For example, you could define the abbreviation myv6sasfiles, which would expand to 'c:\winnt\profiles\myid\personal\mysasfiles\v6';. Abbreviations are actually macros whose task is to insert one or more lines of text.

To create an abbreviation

  1. Select

    Tools
    [arrow]
    Add Abbreviation...

  2. In the Abbreviation field, enter the name of the abbreviation.

  3. In the Text to insert for abbreviation field, enter the text the abbreviation will expand into.

  4. Click on [OK].

To use an abbreviation, type the abbreviation. When an abbreviation is recognized, a tooltip displays the expanded text. Press the Tab key or Enter key to accept the abbreviation.

To modify an abbreviation:

  1. Press Ctrl + Shift + M or select

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Macros...

  2. Select the abbreviation from the list of Current Macros.

  3. Click on Edit.

  4. Select the string in the Macro Contents field.

  5. Click on [Modify].

  6. Make your modification in the Insert String dialog box and click on [OK].

  7. Click on [OK] in the Edit Keyboard Macros dialog box.

  8. Click on [Close] in the Macro dialog box.

To delete an abbreviation:

  1. Press Ctrl + Shift + M or select

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Macros...

  2. Select the abbreviation from the list of Current Macros.

  3. Click on Delete.

  4. Click on [Close].


Submitting Your Program

To submit your program, do one of the following:

The Enhanced Editor Options dialog box provides the Clear text on submit setting for you to specify whether or not you would like the contents of the Enhanced Editor window cleared after submitting your program. If you would like your program to remain in the editor window, be sure not to select this option. For more information, see Setting Enhanced Editor Options.

Using Keyboard Mappings

The Enhanced Editor provides extensive keyboard mappings for the Enhanced Editor. Keyboard Shortcuts within the Enhanced Editor provides a complete list of commands and their default keyboard shortcuts.

Some of the more useful default keyboard mappings include:

Useful Keyboard Shortcuts
Add a new abbreviation CTRL + Shift + A
Toggle expand current line Alt + Num *
Collapse all code sections Alt + Ctrl + Number pad-
Expand all code sections Alt + Ctrl + Number pad +
Toggle marker on the current line Ctrl + F2
Go to the next marked line F2
Go to the previous marked line Shift + F2
Go to line Ctrl + G
Convert selected text to uppercase Ctrl + Shift + U
Convert selected text to lowercase Ctrl + Shift +L

For information on defining keyboard shortcuts, see Customizing the Enhanced Editor Keyboard. For a complete list of keyboard shortcuts, see Keyboard Shortcuts within the Enhanced Editor.

Using Keyboard Macros

A keyboard macro is a series of Enhanced Editor commands and instructions that you group together as a single command to accomplish a task automatically. Instead of manually performing a series of time-consuming, repetitive actions, you can create and run a single macro. You run a macro from the Tools menu or by using a keyboard shortcut. For information on defining a keyboard shortcut for using macros, see Customizing the Enhanced Editor Keyboard.

You can create a macro by recording it from the Enhanced Editor window:

  1. Start recording either by pressing Alt + Shift + R or by selecting

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Record New Macro

  2. Execute the sequence of actions to accomplish the task.

  3. Stop recording either by pressing Alt + Shift + R or by selecting

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Stop Recording

  4. If desired, define a keyboard shortcut to play the macro. For information, see Customizing the Enhanced Editor Keyboard.

An alternative way to create a macro is to add commands using the Create Keyboard Macro dialog box. To do this:

  1. Open the Keyboard Macros dialog box by pressing Ctrl + Shift + M or by selecting

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Macros...

  2. Click on [Create...] to open the Create Keyboard Macro dialog box..

  3. Enter the name of the macro in the Keyboard macro name: field.

  4. Enter a description of the macro in the Keyboard macro description: field.

  5. The Keyboard macro contents: list box lists the commands in the order in which they will be executed.

    To add a command, select the command from the Commands: list box and click on the double right-directional button. Repeat this step until all commands are listed in the Keyboard macro contents: list box.

    You can reorder commands by selecting the command in the Keyboard macro contents: list box and clicking on up or down directional button.

    To delete a command, select the command and click on [Delete].

  6. When all of the commands are present in the list box and are ordered correctly, click on[ OK].

  7. In the Keyboard Macros dialog box, click on [Close].

To play a macro, use a keyboard shortcut or :

  1. Select

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Run Macro...

  2. In the Run Macro dialog box, select a macro and click on [Run].

To edit a macro:

  1. Open the Keyboard Macro dialog box by pressing Ctrl + Shift + M or by selecting

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Macros...

  2. Select a macro and click on [Edit...] to open the Edit Keyboard Macro dialog box.

  3. To add a command, select a command from the Commands: list box and click on the double right-directional button.

    To modify a command, first be sure you can modify the command by selecting the command from the Keyboard macro contents list box. If a command can be modified, the [Modify] button is active. Click on [Modify] to open a dialog box which will enable you to modify the command.

    To delete a command, select the command in the Keyboard macro contents list box and click on [Delete].

    To reorder a command, select the command and click on the up or down directional button.

  4. When the commands are in the correct order, click on [OK].

To delete a macro,

  1. Press Ctrl + Shift + M or select

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Macros...

  2. Select the macro and click on [Delete].

  3. Click on [Yes] in the Delete Macro dialog box.

  4. Click on [Close].

This example lists the steps to create an RSUBMIT statement, an ENDRSUBMIT statement, a blank line between these statements, and tabs in by the amount specified Tabs size: field in the Enhanced Editor Options dialog box.

  1. Select

    View
    [arrow]
    Enhanced Editor

  2. Select

    Tools
    [arrow]
    Keyboard Macros
    [arrow]
    Record New Macro
    and click on [OK] in the message box.

  3. In the Enhanced Editor window:
    1. Press Enter.

    2. Enter rsubmit;

    3. Press Enter.

    4. Press Enter.

    5. Enter endrsubmit;

    6. Press the Up arrow.

    7. Press the Tab key.

    8. Select

      Tools
      [arrow]
      Keyboard Macros
      [arrow]
      Stop Recording

The resulting macro contains the following commands:

Insert carriage return
Insert character ['r']
Insert character ['s']
Insert character ['u']
Insert character ['b']
Insert character ['m']
Insert character ['i']
Insert character ['t']
Insert character [';']
Insert carriage return
Insert carriage return
Insert character ['e']
Insert character ['n']
Insert character ['d']
Insert character ['r']
Insert character ['s']
Insert character ['u']
Insert character ['b']
Insert character ['m']
Insert character ['i']
Insert character ['t']
Insert character [';']
Move cursor up
Insert character ['|']

Keyboard macros can be shard by multiple users by importing or exporting them to or from a folder using the Keyboard Macros dialog box. To open the Keyboard Macros dialog box, select

Tools
[arrow]
Keyboard Macros
[arrow]
Macros...

To import a keyboard macro, click on [Import], select a folder from the Look in: drop-down list box and a filename from the list box. Then click on [OK].

To export a keyboard macro, click on [Export], select a folder from the Look in: field, type a file name in the File name: field, and click on [OK].

Using Collapsible Code Sections

Collapsible code sections, when enabled, allows you to expand or collapse one or more sections of code. Refer to The Enhanced Editor When Collapsible Code Segments Are Enabled to see the expand and collapse controls, and the brackets and lines that delineate code sections.

A section begins with a section word, a comment, or spaces above a section word or comment. A section ends with the next section keyword, a comment, or space above the next section word or comment. Section words include the DATA statement, the PROC statement, and the %MACRO statement. The signature line is the line in which the section word appears.

An expanded section is indicated by the [-] control in the margin at the signature line. To collapse a section, click on [-].

A collapsed section is indicated by the [+] control in the margin and the signature line is the only line of code that is displayed. To expand a section, click on [+] in the margin.

The Enhanced Editor When Collapsible Code Segments Are Enabled

[IMAGE]

Brackets in the margin and a section line across the editor window mark the beginning and ending of a section. If you don't want to see the brackets or the section line, you can turn them off using the Enhanced Editor dialog box.

To disable collapsible code sections, or brackets and lines, select

Tools
[arrow]
Options
[arrow]
Enhanced Editor...
[arrow]
General
and deselect the appropriate settings:

The following rules apply when you are selecting and editing collapsed segments:


Setting Enhanced Editor Options

You can customize how the Enhanced Editor works for you by using the Editor Options dialog box, as shown in Editor Options Dialog Box.

Editor Options Dialog Box

[IMAGE]

.

To open the Editor Options window from the menu, be sure an Enhanced Editor window is the active window and select

Tools
[arrow]
Options
[arrow]
Enhanced Editor...

Click on the tabs that are located along the top of the dialog box to navigate to the settings that you want to change, and then select the options you want. When you are finished, click on [OK].

The following sections describe the pages (or tabs) of the Editor Options dialog box and how to set the formatting options.

General Editor Options

The General page lets you specify the general options that control how the Enhanced Editor works. The following are the General options:

Allow cursor movement past end of line
specifies where the insertion point is positioned when you click the mouse pointer after the last text character on a line. If selected, the insertion point is positioned where you click the mouse pointer. If not selected, the insertion point is positioned after the last text character on the line.

Drag and drop text editing
specifies whether selected text can be moved using drag and drop. If checked, selected text can be moved using drag and drop. If not checked, selected text cannot be moved using drag and drop.

Show line numbers
specifies whether to display line numbers in the margin. When line numbers are displayed, the current line number is red.

File type:
specifies the type of file to which tabs, indentation and collapsibe code sections apply. File types include HTML documents, SAS System program, SCL programs, and text documents.

Tab size:
specifies the number of spaces to indent.

Insert spaces for tabs
specifies whether to insert the space character or the tab character when you press the Tab key. If selected, the space character is used. If not selected, the tab character is used.

Indentation
specifies the type of indentation to use. When None is selected, no indentation is used. When Automatic is selected, the next line is automatically indented by the same amount of space the previous line is indented.

Collapsible code sections
specifies whether to enable the expansion and contraction of code sections. If selected, the collapsible code sections can be collapsed or expanded. If not selected, all code displays in the editor window. The following settings are active when the Collapsible code sections setting is selected:

Clear text on submit
specifies whether to clear the contents of the Enhanced Editor window after you submit a program for processing. If selected, the Enhanced Editor window is cleared when you submit the program. If not selected, your program remains in the editor window. If this setting is selected, you can recall the last submitted program using the F4 key.


Appearance Options

The Appearance options let you specify foregound and background colors, and font styles for SAS program elements. You can also create and save color schemes. For more information on using these appearance options, see Setting Appearance Options and Using Schemes. The following are the Appearance options:

File type:
specifies the type of file whose elements you want to color-code. You can color-code file elements for SAS System programs, SCL programs, HTML documents, and text documents. The default is the file type of the file you are editing at the time you invoke the Editor Options dialog box.

Scheme:
is a name that represents a saved set of appearance options for the specified file type.

Name:
specifies the name of the font for the scheme.

Size:
specifies the font size for the scheme.

Script:
lists the available language scripts for the specified font.

File elements
lists the elements of the specified file type that can be color-coded.

Foreground:
specifies the text color that is to be applied to the selected file element.

Background:
specifies the background color that is to be applied to the selected file element.

Font Style:
specifies whether Normal, Bold, Italic, or Bold Italic font style to be applied to the file element.

Underlined
specifies whether the file element is to be underlined.

Sample:
displays a sample of the selected file element colors and font.


Setting Appearance Options

When you set appearance options, you set them for the elements of the file type specified in the File type: drop-down list. As you make your selections, the Sample box displays your selected formatting. The formatting options that you specify are applied to all opened Enhanced Editor windows of that file type. When you start the SAS System, the formatting options that are applied to the Enhanced Editor files are the formatting options that were in effect when the SAS System last ended.

To specify appearance options:

  1. Open the Editor Options window by selecting

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor...
    [arrow]
    Appearance

  2. Select a file type from the File type: drop-down list.

  3. Optionally, you can select a saved formatting scheme from the Scheme: drop-down list. For more information on using schemes, see Using Schemes.

  4. From the Name: drop-down list , select a font.

  5. From the Size: drop-down list, select a font size.

  6. From the Script: drop-down list, select a script appropriate for the language your computer is set up on.

  7. For each file element you want to format:
    1. Select a file element.

    2. Click in the Foreground: drop-down list and select a color for the file element. To create a custom color, select Custom and create a color from the Color dialog box.

    3. Click on the Background: drop-down list and select a color for the background of the file element. To create a custom color, select Custom and create a color from the Color dialog box.

    4. From the Font Style: drop-down list, select Normal, Bold, Italic, or Bold Italic.

    5. If you want the element underlined, select the Underlined box.

  8. Review your selections in the Sample box. Click on a file element in the sample to see its color and font assignment. When you are done formatting all file elements, click on [OK].


Using Schemes

A scheme is a saved set of formatting options. After creating a scheme, you can set Enhanced Editor appearance options by selecing only a file type and a scheme. Using a scheme saves you from setting each individual file element.

To create a scheme:

  1. Select a file type from the File type: drop-down list.

  2. Select a font, font size, and a script.

  3. For each file element, select a color for the foreground and background, a font style, and the underlining option.

  4. Click on Save As... and enter a scheme name in the Save Scheme dialog box.

  5. Click on [OK].

To modify a scheme:

  1. Click in the File type: drop-down list. and select a file type.

  2. Click in the Scheme: drop-down list and select a scheme.

  3. Make the font and file element changes you want.

  4. Click on Save As... The selected scheme name will be in the Scheme name entry box.

  5. Click on [OK].

To delete a scheme:

  1. Click in the File type: drop-down list and select a file type.

  2. Click in the Scheme drop-down list and select.

  3. Click on [Delete].


Customizing the Enhanced Editor Keyboard

You can customize Enhanced Editor commands and keyboard macros using the Enhanced Editor Keys dialog box.


Assigning Keyboard Shortcuts

When you open Enhanced Editor Keys dialog box, you can view only commands that have assigned keyboard shortcuts, or you can view all commands. To see only the commands with assigned keyboard shortcuts, be sure that the Show all commands check box is not selected. To see all commands, including those that have no key assignment, check the Show all commands check box.

To assign keyboard shortcuts:

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor Keys

  2. Select a category from the Categories: drop-down list box. Macros are listed in the User Defined category.

  3. Select a command from the Commands list box. If a keyboard shortcut is already defined for the command, it is displayed in the Keys column.

  4. Click on [Assign keys...].

  5. Place the cursor in the Press new shortcut key: field.

  6. Press a key sequence for the selected command. The sequence displays in the Press new shortcut key: field and the assignment status for that key displays at the bottom of the dialog box. If New shortcut key is currently assigned to: is None, then no other command is assigned to this keyboard shortcut.

  7. In the [When:] drop-down list box, select when to use the shortcut key. Select Always to execute the command whether text is selected or not. Select Text is selected to execute the command when there is selected text. Select No text is selected to execute the command when no text is selected.

  8. To assign the keyboard shortcut, click on [Assign].

    Note:   Assigning a keyboard shortcut to a key sequence that is assigned to another command will delete the shortcut for that command. For example, if you assign the Backspace key to the Add a new abbreviation command, pressing the Backspace key displays the Add Abbreviation dialog box and you can no longer backspace using the Backspace key.  [cautionend]


Deleting Keyboard Shortcuts

To delete a keyboard shortcut:

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor Keys

  2. Click on [Assign keys...].

  3. Select the category in the Categories: list box. Macros are listed in the User Defined category.

  4. Select the command in the Commands: list box.

  5. Select the key sequence in the Keys currently assigned to command: list box.

  6. Click on [Delete].


Resetting Keyboard Shortcuts to the Enhanced Editor Defaults

Resetting keyboard shortcuts to the default keyboard shortcuts will delete all macro keyboard shortcuts. See Keyboard Shortcuts within the Enhanced Editor for a list of the default keyboard shortcuts.

To reset keyboard shortcuts to the Enhanced Editor default keyboard shortcuts:

  1. Select

    Tools
    [arrow]
    Options
    [arrow]
    Enhanced Editor Keys

  2. Click on [Assign keys...].

  3. Click on [Reset All].


Enabling and Disabling the Enhanced Editor

By default, the Enhanced Editor is enabled when you start the SAS System. To disable the Enhanced Editor when you start the SAS System, use the NOENHANCEDEDITOR system option. For more information about the NOENHANCEDEDITOR system option, see ENHANCEDEDITOR. You can also enable or disable the Enhanced Editor using the Use Enhanced Editor setting in the Preferences dialog box Edit page or by using the WEDIT command. For more information on the WEDIT command, see WEDIT.

When you disable the Enhanced Editor, Enhanced Editor menu commands are not available. All opened Enhanced Editor windows remain open and you are able to open new Enhanced Editor windows using the View menu or the WEDIT command. If the Enhanced Editor is disabled when you start the SAS System, the Enhanced Editor window will not open.

When the Enhanced Editor is enabled, the Text Editor command in the Tools menu will open an Enhanced Editor window. When the Enhanced Editor is disabled, the Text Editor command opens SAS NOTEPAD.


Chapter Contents

Previous

Next

Top of Page

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