
The Enhanced Editor is an ASCII editor that uses visual aides that help you program and debug your SAS programs.
| Enhanced Editor Features |
The Enhanced Editor includes many of the features from the Program Editor in addition to the following:
| Enabling and Disabling the Enhanced Editor |
The first time you start the SAS System after installation, the Enhanced Editor is enabled and an empty instance of the Enhanced Editor is opened. You enable or disable the Enhanced Editor using the Use Enhanced Editor setting in the Preferences dialog box Edit page.
To enable or disable the Enhanced Editor:
Whenever the Enhanced Editor is enabled, a new instance of the editor is opened, the status line displays the current cursor position for the new Enhanced Editor window, and commands are added to the Tools menus as follows:
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 WEDIT command. If the Enhanced Editor is disabled when you start the SAS System, the Enhanced Editor window will not open.
| Opening Files |
You can open files in the Enhanced Editor whether or not the Enhanced Editor is enabled or disabled. When the Enhanced Editor is enabled, you can open files using:
When the Enhanced Editor is disabled, you can open Enhanced Editor files using the WEDIT command in the command bar or by selecting View -> Enhanced Editor
To stop the Enhanced Editor from opening a new file when the SAS System starts, disable
the Enhanced Editor from the Preferences dialog box Edit page by unchecking the Use
Enhanced Editor check box.
When the Enhanced Editor is enabled, the View menu and the Tools menu contain commands to open an Enhanced Editor window.
To open an Enhanced Editor window using the View menu, select View -> Enhanced Editor
To open an Enhanced Editor window using the Tools menu, select Tools ->
Text Editor The Text Editor command in the Tools menu opens an Enhanced
Editor window when the Enhanced Editor is enabled. When it is not enabled, the Text
Editor command opens the SAS NOTEPAD.
For more information about the WEDIT command, see WEDIT.
When an Enhanced Editor window is the active window, you can open existing files in the Enhanced Editor using the Open dialog box. To do this, click the mouse pointer on an existing Enhanced Editor window bar button and do one of the following to open the Open dialog box:
From the Open dialog box, select the file you want to open and then click on OK.
| Saving Files |
An asterisk ( * ) that appears in the 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.
To save a file to the file in the Enhanced Editor window title bar, do one of the following:
To save a file for the first time or to save a file with a new name
You can also define key sequences to save a file to disk in either read-only or write mode. For more information about using key sequences, see Using Keyboard Mappings.
| Checking for Errors |
| Using the Enhanced Editor Window |
ADD INTRO TEXT HERE.
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.
Once you start entering text, the title bar displays an asterisk ( * ). The asterisk indicates that there is text in the file that has not been saved to disk. Once you save a file, the file name displays in the title bar and the asterisk disappears until you start entering additional text.
On the left side of the Enhanced Editor window is the decoration pane and the code
folding pane. These panes appear as one pane when code folding is enabled. The decoration
pane is used to select lines of text, display line numbers, and create bookmarks. The code
folding pane is used to expand and collapse sections of code.
The Enhanced Editor provides extensive keyboard mappings for
Code folding, when enabled, allows you to expand or collapse one or more sections of code. A section begins with a section word and ends before the next section word. Section words include the DATA statement, the PROC statement, and the %MACRO and %MEND statements. An anchor line is the line in which the section word appears.
To collapse a section, click on -.
To expand a section, click on +.
To enable code folding:
To disable code folding:
General
When code folding is disabled, the code folding pane does not display.
For rules on selecting, editing, searching, and replacing text in collapsible sections, see
When you press the Enter key, you can automatically indent the next line either by the amount of space the current line is indented or by the amount of space specified for the Tab size. The latter option is useful as the Enhanced Editor can indent the amount specified for the Tab size after keywords and section words such as PROC and DO.
To indent by the amount of space the current line is indented:
Enhanced Editor
To indent after a keyword by the amount of space specified for the Tab key:
Enhanced Editor
If you prefer not to automatically indent, select the None radio button.
Whether you use automatic indenting or not, pressing the Tab key inserts spaces by the amount of space specified in the Tab size field and moves any text to the right of the cursor. You can specify whether the tab space is to contain the space character or no character using the Insert spaces for tabs check box. If this check box is not selected, blanks are inserted in the tab space.
Note: Changing the tab size will modify tab settings to the new
value in all Enhanced Editor windows. ![[cautend]](ms-its:common.chm::/common.hlp/images/cautend.gif)
A 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 keyboard shortcut for using macros, see Customizing the Enhanced Editor Keyboard.
To record a macro:
Record
new macro
Stop
recording .
An alternative way to create a macro is to add commands using the Create Macro and Select Commands dialog boxes. To do this:
Edit Macros...
. Repeat this step until all commands are listed in the Macro Contents list box. You can
reorder commands by selecting the command and clicking on ? to move
the command towards the beginning of the macro or
to move the command
towards the end of the macro. To play a macro, use a keyboard shortcut or:
Play Macro To edit a macro:
Edit Macros...
. To delete a macro,
Edit Macros...
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.
Enhanced Editor
Record New Macro rsubmit endrsubmit;
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 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 ['|']
Using key sequences that you define in the Date/Time category of the Enhanced Editor Keys dialog box, you can add static dates and times to a file. The dates and times that you can add to a file are listed in Available Dates and Times. To update dates and time, rekey the appropriate date/time key sequence. For information on how to define key mappings, see Using Keyboard Mappings.
| Date or Time | Example |
|---|---|
| Current 2-digit year | 99 |
| Current date and time | Friday, September 3, 1999 08:28:07 |
| Current day of month | 03 |
| Current day of week | Friday |
| Current hour in a 12-hour style | 08 |
| Current hour in a 24-hour style | 22 |
| Meridian indicator | am |
| Current minute | 28 |
| Current month index | 09 |
| Current month name | September |
| Current second | 07 |
| Current year | 1999 |
When you bookmark a line, you create a line marker that is used to easily access that line.
To bookmark a line, press Ctrl + F2 on an unmarked line.
To unmark a line, press Ctrl + F2 on a bookmarked line.
To go to the next bookmarked line, press the F2 key.
To go to the previous bookmark, press Shift + F2.
A vertical rectangle in the decoration pane indicates that the line is bookmarked. You can create key sequences for bookmarking commands listed in Bookmarking Commands. For information on creating and using key sequences, see Customizing the Enhanced Editor Keyboard Using Keyboard Mappings.
| Go to the next marked line |
| Go to the previous marked line |
| Mark the current line |
| Remove all line markers |
| Toggle marker on the current line |
| Unmark the current line |
To find text:
Down specifies to search from the cursor position towards the bottom of the file.
You can find and replace text by searching the entire file or by selecting a subset of text and searching only the subset.
To find and replace text
Down specifies to search from the cursor position towards the bottom of the file.
Use the key sequences in Key Sequences for Moving the Cursor to move the cursor within the Enhanced Editor.
To go to a specific line, use the Go To Line dialog box:
, use the key sequence Ctrl + G.
For more information about using line numbers, see Using Line Numbers.
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:
| Use Key Sequence | To Move the Cursor.... |
| Ctrl + G | to a specific line number |
| Down arrow | down one line |
| Up arrow | up one line |
| Page Down | down a page |
| Page Up | up a page |
| Left arrow | left one character |
| Right arrow | right one character |
| Ctrl + Home | to the beginning of the document |
| Ctrl + End | to the end of the document |
| Home | to the beginning of the current line |
| End | to the end of the current line |
| Ctrl + 0 Ctrl + 9 Ctrl + [ Ctrl + ] |
to the matching parenthesis or bracket |
| Alt + right arrow | to the next case change or word boundary |
| Alt + left arrow | to the previous case change or word boundary |
| Ctrl + right arrow | to the start of the next word |
| Ctrl + left arrow | to the start of the previous word |
| Alt + up arrow | to the first visible line |
| Alt + down arrow | to the last visible line |
| Shift + Tab + No Selection | backwards to the previous tab stop |
| Ctrl + up arrow | towards the top of the file while scrolling up |
| Ctrl + down arrow | towards the bottom of the file while scrolling down |
To move or copy text in your file using drag and drop:
To copy the text, press the Ctrl key and drag the text to the desired location and release the mouse button.
Line numbers appear in the decoration pane with the current line color coded in red. Line numbers can be turned on and off from the Editor Options dialog box.
To turn number on or off:
To submit your program, do one of the following:
| Setting Enhanced Editor Options |
You can customize how the Enhanced Editor works for you using the Editor Options dialog box.
To open the Editor Options window from the menu Tools -> Options -> 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:
The General page lets you specify the general options that control how the Enhanced Editor works. The following are the General options:
The Format 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 formatting options, see Setting Formatting Options and Using Schemes. For a list of default format option settings, see (new appendix goes here). The following are the Format options:
When you set formatting 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 sessions 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 formatting options:
A scheme is a saved set of formatting options. After creating a scheme, you can set Enhanced Editor formatting 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:
To modify a scheme:
To delete a scheme:
| Customizing the Enhanced Editor Keyboard |
Last updated: 01/18/06 by Karl Ho