Using the SAS Editors under Windows |
Enhanced Editor Features |
While retaining some familiar Program Editor features, the Enhanced Editor enables you to
use color-coding to identify SAS and SCL program elements as well as HTML and XML document elements. Color-coding settings can be saved in a color scheme.
view the high-level flow of your SAS program or see each detailed statement by expanding or contracting sections of SAS procedures, DATA steps, and macros.
create macros that record and play back program editing commands by using the keyboard macro recorder.
bookmark lines of code for easy access to different sections of your program or document.
customize keyboard shortcuts for most Enhanced Editor commands.
access Help for the SAS language by placing the insertion point within the language element name and pressing F1.
Using the Enhanced Editor Window |
The parts of the Enhanced Editor window are shown in the following display:
The title bar contains the Enhanced Editor icon and the name of the file. If the file is new, the filename is Editor Untitledx, where x is a window number. An asterisk ( * ) in the title bar indicates that any changes to the file have not been saved.
An expanded code section displays all of the code within the code section. It is indicated in the margin by the minus sign ( - ).
A collapsed code section displays only the signature line of code (the line of code that contains the keyword). It is indicated in the margin by the plus sign ( + ).
Part of the main SAS window, the Enhanced Editor insertion point position displays the insertion point line and column position.
You use the margin on the left side of the Enhanced Editor window to
You can move between Enhanced Editor windows by
The following table shows different methods of opening files in the Enhanced Editor.
Actions | Instructions |
---|---|
Open a new file | Do one of the following: |
Open an existing file by using the Open dialog box | |
Open multiple individual files by using the Open dialog box | |
Open an existing file, bypassing the Open dialog box |
Do one of the following:
|
Open multiple views of an opened file |
When you open multiple views of a file, changes that you make in any view of the file are made simultaneously in all views. |
Append a file to an opened file | |
* The Enhanced Editor must be the active window. |
Note: To change the default directory for the Open dialog box, either start SAS using the SASINITIALFOLDER system option or change the current working directory. For more information, see SASINITIALFOLDER System Option and Changing the SAS Current Folder.
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 the name Editor 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 the Save toolbar button (the diskette). If the file is to be saved for the first time, the Save As dialog box opens for you to name the file.
To save a file with a new name
Note: To change the default directory for the Save dialog box, either start SAS using the SASINITIALFOLDER system option or change the current working directory. For more information, see SASINITIALFOLDER System Option and Changing the SAS Current Folder.
If SAS ends unexpectedly, you can recover the contents of Enhanced Editor windows if the autosave feature is selected in the Preferences dialog box. The Enhanced Editor autosave files are saved in the operating environment Application Data folder with the filename Autosave of filename.$AS, where filename is the name of the file. Under Windows Vista, the pathname for the Application Data folder is c:\Users\userid\AppData. Under all other Windows operating environments, the pathname for the Application Data folder is c:\Documents and Settings\user name\Application Data\SAS\EnhancedEditor. For example, the path to the autosave file for MYPROGRAM.SAS in folder C:\TEMP would be
C:\Documents and Settings\myuserid\Application Data\SAS\EnhancedEditor
\Autosave of myprogram.$AS
SAS deletes autosave files when a file is saved, when the Enhanced Editor window closes, or when a SAS session ends normally. If you have renamed a file and SAS ends abnormally, you will find the autosaved file under the original filename.
For information about setting the autosave feature, see Edit Preferences and WAUTOSAVE Command.
You can see different parts of the same file simultaneously by opening multiple views of the same file. While you are working with multiple views, you are working with only one file, not multiple copies of the same file.
To open multiple views of the same file:
The filename in the title bar is appended with a colon and a view number. For example, myfile.sas:1 and myfile.sas:2.
Changes that you make to a file in one view, such as changing text or bookmarking a line, occur in all views simultaneously. Actions such as scroll bar movement, text selection, and expanding or contracting a section of code occur only in the active window.
The Enhanced Editor supports a limited number of scrolling and line number commands that you might be familiar with from using the Program Editor. All Enhanced Editor commands can be typed only from the command bar.
The Enhanced Editor supports the following scrolling commands:
Command | Description |
---|---|
UP | Move one page toward the beginning of the file. |
DOWN | Move one page toward the end of the file. |
LEFT | Move one page to the left. |
RIGHT | Move one page to the right. |
You can display line numbers either by selecting Show line numbers in the Enhanced Editor Options dialog box or by typing nums in the command bar. To suppress line numbers, either deselect Show line numbers or type nums again in the command bar.
All line number commands begin with a colon ( : ). A space is not required between the command and the number. The following line number commands are supported:
Command | Description | Default Value of n | Maximum Value Allowed | Example |
---|---|---|---|---|
:In | Insert n lines after the current line. | 1 | 9999 | :I4 |
:IAn | Insert n lines after the current line. | 1 | 9999 | :IA4 |
:IBn | Insert n lines before the current line. | 1 | 9999 | :IB2 |
:Dn | Delete n lines starting at the current line. | 1 | 9999 | :D3 |
:Rn m | Repeat the block of m lines, starting with the current line, n times. A space is required between n and m. | 1 | 9999 |
:R1 6
Repeats six lines, starting with the current line, one time. |
The Enhanced Editor accepts numerous key sequences for moving the insertion point, as shown in the following table. The key sequence Ctrl + G opens the Go To Line dialog box. All other key sequences move the insertion point as defined.
Use this key sequence... | To move the insertion point.... |
---|---|
Up arrow | up one line |
Down arrow | down one line |
Left arrow | left by one character |
Right arrow | right by one character |
Page Down | down a page |
Page Up | up a page |
Home | to the beginning of the current line |
Ctrl + Home or | to the beginning of the document |
End | to the end of the current line |
Ctrl + End or | to the end of the document |
Ctrl + up arrow | toward the top of the file while scrolling up |
Ctrl + down arrow | toward 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 + right arrow | to the next case change or word boundary |
Alt + left arrow | to the previous case change or word boundary |
Shift + Tab | backward to the previous tab stop |
In addition to using key sequences, you can move the insertion point up by one page, down by one page, to the left by one page and to the right by one page by using the UP, DOWN, LEFT, and RIGHT commands in the command bar.
By default, when you click the mouse button past the end of a line, the insertion point is placed after the last character in a line.
To enable the Enhanced Editor to place the insertion point past the end of a line:
Use the following mouse and keyboard shortcut actions to select and manipulate text.
Text Selection | Instructions |
---|---|
One or more lines of text using the margin | |
Single or multiple characters, or whole lines of text |
The following keyboard shortcuts are also available to select text.
To... | Instructions |
---|---|
Extend a selection in a particular direction | Press the Shift key and then press a directional arrow. |
Extend a selection one character at a time | Press Shift + left arrow or right arrow |
Unmark selected text | Press any directional key |
Copy selected text | Press Ctrl + C or select Edit Copy |
Cut selected text | Press Ctrl + X or select Edit Cut |
Paste from the clipboard | Press Ctrl + V or select Edit Paste |
Move selected text |
Text that you select appears in reverse video.
For a complete list of selection keyboard shortcuts, see the Selection category in Keyboard Shortcuts within the Enhanced Editor.
Note: In addition to using commands from the Edit menu, you can use editing commands that are available from the pop-up menu when you click the right mouse button in the Enhanced Editor window.
Select the text, place the pointer over the selected text, and hold down the left mouse button.
To copy the text
To disable drag and drop editing
Supply the following information:
Type a text string to find. The initial value of this field is the last text string that was used in a search.
Click the Find in box to specify whether to search in the code only, in the comments only, or in both the code and comments.
Select either the Up or the Down option. Up specifies to search from the insertion point position toward the beginning of the file. Down specifies to search from the insertion point position toward the bottom of the file.
Select the check box to specify that a match of the text must be a whole word and not part of a word.
Select the check box to specify that upper and lowercase characters must match exactly.
Select the check box to specify that the text string is a regular expression. A regular expression uses special characters as wildcards to search for a string or substring. For a selection of special characters that you can use in regular expressions, click the arrow that is located to the right of the Find text field.
Supply the following information:
Type a text string to find and replace. The initial value of this field is the last text string that was used in a search.
Click the Find in box to specify whether to search in the code only, in the comments only, or in both the code and comments.
Select either the Up or the Down option. Up specifies to search from the insertion point position toward the beginning of the file. Down specifies to search from the insertion point position toward the bottom of the file.
Select this check box to specify that any match of the text must be a whole word and not part of a word.
Select this check box to specify that upper- and lowercase characters must match exactly.
Select this check box to specify that the text string includes a regular expression. A regular expression uses special characters as wildcards to search for a string or substring. For a selection of special characters that you can use in regular expressions, click the right arrow that is located to the right of the Find text field.
To assist you in finding coding errors, the Enhanced Editor
See the following table for suggestions about finding coding errors.
Code Error Type | Instructions |
---|---|
Undefined or misspelled keywords |
In the Enhanced Editor Options dialog box Appearance
tab, set the file elements Defined keyword, User defined keyword, and the Undefined keyword to unique color
combinations.
When SAS recognizes a keyword, the keyword changes to the defined colors. You'll be able to easily spot undefined keywords by looking for the colors that you selected for undefined keywords. |
Unmatched quoted strings |
Look for one or more lines of the program that are the
same color.
Text following a quotation mark remains the same color until the string is closed with a matching quotation mark. |
Unmatched comments |
Look for one or more lines of the program that are the
same color.
Text that follows an open comment symbol ( /* ) remains the same color until the comment is closed with a closing comment symbol ( */). |
Matching DO-END pairs |
Place the cursor within a DO-END block and press Alt
+ [.
The cursor moves first to the DO keyword. If one of the keywords is not found, the cursor remains as positioned. When both of the keywords exist, pressing Alt + [ moves the cursor between the DO-END keywords. |
Matching parentheses or brackets |
Place the cursor on either side of the parenthesis or
bracket. Press Ctrl + ].
The cursor moves to the matching parentheses or bracket. If one is not found, the cursor remains as positioned. |
Missing semi-colons ( ; ) | Look for keywords that appear in normal text. |
For a list of the components that you can color-code, open the Enhanced Editor Options dialog box. Select the Appearance tab. The components are listed in the File elements box. For more information about defining colors for program components, see Setting Appearance Options.
When you press ENTER, you automatically indent the next line by the amount of space that the current line is indented. If you prefer not to use automatic indention:
In addition to automatic indenting, you can indent by using the TAB key. Pressing the TAB key moves the insertion point and any text to the right of the insertion point by the amount of space that you specified in the Tab size field of the Enhanced Editor Options dialog box.
Tab characters can be replaced by spaces either when you press the TAB key or when you open a file. To insert spaces instead of tab characters when you press the TAB key, select the Insert spaces for tabs check box. To replace tab characters with spaces when you open a file, select the Replace tabs with spaces on file open check box.
Note: Changing the tab size modifies tab settings to the new value in all Enhanced Editor windows.
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 that you can use with bookmarking.
Action | Keyboard Shortcuts |
---|---|
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 |
You can define a character string so that when you type it and then press the TAB key or the ENTER key, the string expands 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 that insert one or more lines of text.
In the Abbreviation field, type the name of the abbreviation.
In the Text to insert for abbreviation field, type the text that the abbreviation will expand into.
To use an abbreviation, type the abbreviation. When an abbreviation is recognized, a tooltip displays the expanded text. Press the TAB key or the ENTER key to accept the abbreviation.
Press Ctrl + Shift + M or select Tools Keyboard Macros Macros.
Type your modification in the Insert String dialog box and click OK.
You can use Word Tips to help in understanding the abbreviations that you add.
To use Word Tips, you must first add abbreviations.
Press Ctrl + Shift + A.
Add the abbreviation and corresponding text.
Click OK to accept, or click Cancel to discard.
Word tips will automatically appear as you type.
To accept a Word Tip, press Enter. To ignore the Word Tip, press ESC or continue typing.
To recall a Word Tip:
Position the pointer so that it immediately follows the abbreviation. | |
Press Alt + F1. |
You can submit either a complete program or a specified number of lines of your program, beginning with the first line.
Note: The maximum line length is 6K bytes.
Submitting a Complete Program | Instructions |
---|---|
When you open the program in the editor | Select the Submit check box in the Open dialog box. |
From the Enhanced Editor | Do one of the following: |
Use the SUBTOP command to submit either the first line or a specified number of lines of a program.
Submitting Partial Programs | Instructions |
---|---|
Only the top line of a program | Do one of the following: |
A specified number of lines, beginning with the first line |
For more information, see SUBTOP Command.
The Enhanced Editor Options dialog box provides the Clear text on submit setting for you to specify whether you want the contents of the Enhanced Editor window to be cleared after you submit your program. For more information, see Setting Enhanced Editor Options.
If a line of data in a DATALINES or CARDS statement is greater than 256 characters long, the data is read into one observation. You do not need to specify the LRECL option in the FILENAME statement as you do when you submit a long line of data using the Program Editor.
When you submit code or a catalog entry from the Enhanced Editor, the filename or catalog entry name and their respective folders are placed in these environment variables:
contains the full path of the submitted program or catalog entry. The full path includes the folder and the filename.
contains only the name of the submitted program or the catalog entry name.
You can then extract the filename and full path for use in your SAS programs.
After the following DATA step runs and the data is sorted, the PRINT procedure includes the filename in the title and the full path in the footnote of the procedure output. The results are shown in Using an Environment Variable to Place a Filename in DATA Step Output.
data oranges; input variety $ flavor texture looks; total=flavor+texture+looks; cards; navel 9 8 6 temple 7 7 7 valencias 8 9 9 mandarins 5 7 9 ; proc sort data=oranges; by descending total; run; proc print data=oranges; title 'Taste Test Results for Oranges using File ' %sysget(SAS_EXECFILENAME); footnote 'The full path is ' %sysget(SAS_EXECFILEPATH); run;
The resulting output displays the filename in the title and the full path in the footnote:
Using an Environment Variable to Place a Filename in DATA Step Output
These environment variables are set only when code is submitted using the Enhanced Editor in the Windows environment. They are not set when you submit SCL code or when you submit code in a batch session.
However, when SAS is running in batch mode, you can obtain the full path (which includes the filename) by submitting %sysfunc(getoption(SYSIN)) . The following macro can be used to obtain the full path in both a batch session and an interactive session by using the Enhanced Editor:
%let execpath=" "; %macro setexecpath; %let execpath=%sysfunc(GetOption(SYSIN)); %if %length(&execpath)=0 %then %let execpath=%sysget(SAS_EXECFILEPATH); %mend setexecpath; %setexecpath; %put &execpath;
You can also use the following %PUT macro statements to display the filename and full path in the SAS log:
%put Submitted file path is %sysget(SAS_EXECFILEPATH).; %put Submitted file name is %sysget(SAS_EXECFILENAME).;
The environment variables are set to the last submitted program. If a program starts an interactive procedure and subsequent programs are submitted while the interactive procedure is still active, the environment variables are set to the filename and full path of the latest submitted program. The filename and full path of the program that submitted the interactive procedure are no long available.
The Enhanced Editor provides extensive keyboard shortcuts for the Enhanced Editor. Keyboard Shortcuts within the Enhanced Editor provides a complete list of commands and their default keyboard shortcuts. The following table shows some of the more useful keyboard shortcuts.
Keyboard Shortcut | Task |
---|---|
Get help for a SAS procedure | Press the mouse button and place the insertion point within the procedure name and press F1 |
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 |
Go to the beginning of the file | Ctrl + Page Up |
Go to the end of the file | Ctrl + Page Down |
Convert selected text to uppercase | Ctrl + Shift + U |
Convert selected text to lowercase | Ctrl + Shift + L |
For information about defining keyboard shortcuts, see Using Keyboard Shortcuts to Customize the Enhanced Editor.
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 about defining a keyboard shortcut for using macros, see Using Keyboard Shortcuts to Customize the Enhanced Editor.
You can create a macro by recording it from the Enhanced Editor window:
Start recording either by pressing Alt + Shift + R or by selecting Tools Keyboard Macros Record New Macro
Stop recording either by pressing Alt + Shift + R or by selecting Tools Keyboard Macros Stop Recording
If you want, define a keyboard shortcut to run the macro. For information, see Using Keyboard Shortcuts to Customize the Enhanced Editor.
An alternative way to create a macro is to add commands by using the Create Keyboard Macro dialog box. To create the macro:
Open the Keyboard Macros dialog box by pressing Ctrl + Shift + M or by selecting Tools Keyboard Macros Macros
Type the name of the macro in the Keyboard macro name field.
Type a description of the macro in the Keyboard macro description field.
The Keyboard macro contents box lists the commands in the order in which they will be executed.
To add a command, select the command from the Commands box and click the Insert Selected Command button (the double arrow). Repeat this step until all commands are listed in the Keyboard macro contents box.
You can reorder commands by selecting the command in the Keyboard macro contents box and clicking the UP or DOWN arrows.
When all of the commands are present in the box and are ordered correctly, click OK.
To run a macro, use a keyboard shortcut or
Open the Keyboard Macro dialog box by pressing Ctrl + Shift + M or by selecting Tools Keyboard Macros Macros
Select a macro and click Edit to open the Edit Keyboard Macro dialog box.
To add a command, select a command from the Commands box and click the Insert Selected Command button.
To modify a command, first ensure that you can modify the command by selecting the command from the Keyboard macro contents box. If a command can be modified, the Modify button is active. Click Modify to open a dialog box that will enable you to modify the command.
To delete a command, select the command in the Keyboard macro contents box and click Delete.
To reorder a command, select the command and click the up or down button.
This example lists the steps to create an RSUBMIT statement, an ENDRSUBMIT statement, a blank line between these statements, and tabs by the amount that you specified Tabs size field in the Enhanced Editor Options dialog box.
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 shared by multiple users. You can import or export them to or from a folder by using the Keyboard Macros dialog box. To open the dialog box, select Tools Keyboard Macros Macros
To import a keyboard macro, click Import, select a folder from the Look in box and a filename from the Filename box. Then click OK.
To export a keyboard macro, click Export, select a folder from the Look in field, type a filename in the Filename box, and click OK.
Collapsible code sections enable you to expand or collapse one or more sections of code. A section begins with a step keyword, a comment, or spaces above a section word or comment. A section ends with the next step keyword, a comment, or space above the next section word or comment. Step keywords include the DATA statement, the PROC statement, and the %MACRO statement. The signature line is the line in which the step keyword appears.
An expanded section is indicated by a minus sign in the margin next to the signature line. To collapse a section, click the minus sign.
A collapsed section is indicated by a plus sign in the margin, and the signature line is the only line of code that is displayed. To expand a section, click the plus sign.
The Enhanced Editor When Collapsible Code Segments Are Enabled
Brackets in the margin and a section line across the editor window mark the beginning and end of a section. If you do not want to see either the brackets or the section line, you can suppress them by using the Enhanced Editor Options dialog box.
To disable collapsible code sections, or brackets and lines, select Tools Options Enhanced Editor General and select the appropriate settings:
Clear the Collapsible code sections check box to disable collapsible code sections.
Clear the Show section lines in text check box to disable section lines in the editor.
Clear the Show section brackets in margin check box to suppress section brackets in the margin.
The following rules apply when you select and edit collapsed segments:
Selecting a line from the margin that includes a collapsed segment includes all text within the collapsed segment.
Selecting a line of text by dragging the mouse over the text or by using the keyboard selects only that line of text.
Selecting text from above a collapsed section and into a collapsed signature line copies text from the start of the selection to the end of the selection. The selection includes any hidden lines above the signature line up to the end of the selection.
Selecting text on a signature line down into another section marks text from the beginning of the selection to the end of the selection and includes hidden text below the signature line.
Pasting into a signature line or section expands the section.
Typing something above a section that affects the section, such as comments or quotes, expands the section.
Pressing ENTER at the beginning of a signature line adds code at the beginning of the section.
Pressing ENTER at the end of a signature line adds code at the end of the section.
Selecting Undo will not undo the collapse and expand commands.
When you search for text and the text is found within a collapsed segment, the segment expands.
When text within a collapsed segment is to be replaced, the segment expands.
When text within a collapsed segment is to be replaced and you select Replace All, collapsed sections do not expand.
Creating Your Own Keywords |
In addition to the many SAS program file elements that you can format within the Enhanced Editor, you can create user-defined keywords for programming elements such as SAS procedure statements, variables, and user-defined formats. The appearance of user-defined keywords overrides the appearance of identical keywords that are defined in the SAS language.
Use the following rules for naming keywords:
The first letter must be a letter ( A, B, C, ... Z) or an underscore ( _ ).
Subsequent characters can be letters, numeric digits ( 0, 1, ... 9) or underscores.
You can use uppercase or lowercase letters. Keywords are not case-sensitive.
To create and format user-defined keywords, use the Enhanced Editor Options dialog box as follows:
To rename a keyword from the User Defined Keywords dialog box
To delete a keyword from the User Defined Keywords dialog box
Associating File Extensions with File Types |
The following table lists the default file extensions for the types of files that are recognized by the Enhanced Editor.
File Type | Default File Extension |
---|---|
SAS Program File | .sas |
SCL Program File | .scl |
HTML Document | .htm, .html, .xml |
To associate other file extensions with SAS and SCL programs, and HTML and XML documents, do the following:
To delete a file extension, select the file extension and click Delete.
To revert to the default file extensions, click Default.
Setting Enhanced Editor Options |
To open the Enhanced Editor Options window from the menu, ensure that an Enhanced Editor window is the active window and select Tools Options Enhanced Editor
.Click 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 that you want. When you are finished, click OK.
From the General tab you can specify the following options that control how the Enhanced Editor works.
specifies where the insertion point is positioned when you click the mouse pointer after the last text character on a line. If it is selected, the insertion point is positioned where you click the mouse pointer. If it is not selected, the insertion point is positioned after the last text character on the line.
specifies whether selected text can be moved by using drag-and-drop editing. If it is selected, selected text can be moved. If it is not selected, selected text cannot be moved.
specifies whether to display line numbers in the margin. When line numbers are displayed, the current line number is red.
specifies to remove the Ctrl+Z end-of-file characters that might be included in files that were created in a DOS editor.
specifies the type of file to which tabs, indention, and collapsible code sections apply. File types include HTML documents, SAS programs, SCL programs, and text documents.
specifies whether to insert the space character or the tab character when you press the TAB key. If it is selected, the space character is used. If it is not selected, the tab character is used.
specifies whether to replace all tab characters in a file with the space character when the file is opened.
specifies the type of indention to use. When None is selected, no indention is used. When Automatic is selected, the next line is automatically indented by the same amount of space that the previous line is indented.
specifies whether to enable the expansion and contraction of code sections. If it is selected, the collapsible code sections can be collapsed or expanded. If it is not selected, all code appears in the editor window. The following settings are active when the Collapsible code sections setting is selected:
specifies whether to clear the contents of the Enhanced Editor window after you submit a program for processing. If it is selected, the Enhanced Editor window is cleared when you submit the program. If it is not selected, the program remains in the editor window. If this setting is selected, you can recall the last submitted program by using the F4 key.
opens the User Defined Keywords dialog box that you use to create user-defined keywords.
opens the SAS Extensions dialog box. Use the SAS Extensions dialog box to define file extensions that are recognized by the Enhanced Editor.
The following appearance options enable you to specify foreground and background colors, and font styles for file elements. You can also create and save color schemes. For more information about using these appearance options, see Setting Appearance Options and Using Schemes.
specifies the type of file whose elements you want to color-code. You can color-code file elements for SAS programs, SCL programs, HTML and XML documents, and text documents. To color-code an XML document, select HTML Document. The default is the file type of the file that you are editing at the time that you invoke the Editor Options dialog box.
is a name that represents a saved set of appearance options for the specified file type.
lists the character sets available for the specified font. The character set that is used by the default script is determined by the Windows regional options.
lists the elements of the specified file type that can be color-coded.
specifies the text color that is to be applied to the selected file element.
specifies the background color that is to be applied to the selected file element.
specifies whether Normal, Bold, Italic, or Bold Italic font is to be applied to the file element.
displays a sample of the selected file element colors and font.
When you set appearance options, you set them for the elements of the file type that you specified in the File type box. 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 SAS, the formatting options that are applied to the Enhanced Editor files are the formatting options that were in effect when the last SAS session ended.
Open the Editor Options window by selecting Tools Options Enhanced Editor Appearance
You can also select a saved formatting scheme from the Scheme box. For more information about using schemes, see Using Schemes.
From the Script box, select a script that is appropriate for the language that your computer uses. The Default script is determined by the Windows regional options.
For each file element that you want to format
Click in the Foreground box and select a color for the file element. To create a custom color, select Custom and create a color from the Color dialog box.
Click the Background box 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.
Note: Changing the background color for Normal text changes the Enhanced Editor window to the specified color.
From the Font Style box, select Normal, Bold, Italic, or Bold Italic.
If you want the element to be underlined, select the Underlined box.
Review your selections in the Sample box. Click on a file element in the sample to see its color and font assignment. When you have finished formatting all file elements, click OK.
A scheme is a saved set of formatting options, such as font, font size, and script. You can set your appearance options by selecting a file type and a scheme instead of setting individual file elements. SAS provides several schemes which you can select from the Scheme box. Schemes provided by SAS use the Default script.
For each file element, select a color for the foreground and background, a font style, and the underlining option.
Click Save As and type a scheme name in the Save Scheme dialog box.
Using Keyboard Shortcuts to Customize the Enhanced Editor |
You can customize Enhanced Editor commands and keyboard macros by using the Enhanced Editor Keys dialog box.
For more information, select the following topics:
When you open the Enhanced Editor Keys dialog box, you can choose to view only commands that have been assigned keyboard shortcuts, or you can view all commands. To see only the commands that have assigned keyboard shortcuts, ensure that the Show all commands check box is not selected. To see all commands, including the commands that have no key assignment, check the Show all commands check box.
Select a category from the Categories box. Macros are listed in the User Defined category.
Select a command from the Commands box. If a keyboard shortcut is already defined for the command, it is displayed in the Keys column.
Place the insertion point in the Press new shortcut key field.
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 appears at the bottom of the dialog box. If the value in the Currently assigned to field is None, then no other command is assigned to this keyboard shortcut.
To assign the keyboard shortcut, click Assign.
Note: Assigning a keyboard shortcut to a key sequence that is assigned to another command deletes 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 by using the Backspace key.
Select the category in the Categories box. Macros are listed in the User Defined category.
Select the key sequence in the Keys currently assigned to command box.
Resetting keyboard shortcuts to the default keyboard shortcuts deletes 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
Enabling and Disabling the Enhanced Editor |
By default, the Enhanced Editor is the active editor when you start SAS.
To disable the Enhanced Editor when you start SAS, use the NOENHANCEDEDITOR system option. For more information, see ENHANCEDEDITOR System Option. You can also enable or disable the Enhanced Editor by using the Use Enhanced Editor setting in the Preferences dialog box Edit tab or by using the wedit command. For more information, see WEDIT Command.
When you disable the Enhanced Editor, the menu commands are not available. All opened Enhanced Editor windows remain open, and you can open new Enhanced Editor windows by using the View menu or the wedit command. If the Enhanced Editor is disabled when you start SAS, the Enhanced Editor window does not open.
When the Enhanced Editor is enabled, the Text Editor command in the Tools menu opens an Enhanced Editor window. When the Enhanced Editor is disabled, the Text Editor command opens SAS NOTEPAD.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.