Home of the SAS editor
SAS editing tool
Support for your SAS toolkit
Tools for SAS programming
SAS editor for the new millenium SAS tool, toolkit or IDE buy it today

SAS Editing Features

Conventions
Buttons
Menu Items
Litterals
Templates
Selected text
Cusrsor |

These are powerful features that help you while you are coding. Many are automatic, in that no action on you part is necessary for them to work. Others work by selecting some text and then invoking a macro.

Also: Language Templates, we have over 300 Run SAS from editor, see results in editor Power Tools, code with a click

Click on image below to stop animation
You can place a lot of text in a block comment with a  click
Whether it is collecting a bunch of text in a comment block or commenting out a block of code to debug a problem, our comment tools make it easy.

Find a page Fast


Smart Indenting

As you type code, smart indenting will reposition your cursor to the correct column every time you press enter at the end of a line. The indent macro examines the code you typed (and the lines before the current line) in order to determine what should happen to the indent level. This works both when you are typing lines serially or if you insert lines in the middle of existing code.

The rules that are used to determine indent level can be broken into a small number of statement types. The standard indent amount is 2 spaces. Two spaces were chosen because it provides enough of a visual clue without using a lot of line space for those limited to 72 columns. Continued lines, e.g., lines that don't end in a semicolon are indented 4 spaces. A line is indented if it occurs after an enclosing structure such as do ... end , or data ... run . A closing syntax word is a keyword like end or run. When a closing syntax word is encountered the word is un-indented and the indent level is moved to the left.

Additionally, when an end keyword is encountered, an end comment like /* if */ is tacked on to the end of the line after the semicolon. This comment identifies the keyword that began the syntactical block. This is useful in deeply nested code. If a %mend is encountered it is similarly labeled with the name of the macro.

Back to the top


Syntax highlighting

The editor has a range of groupings of items that can have coloring or highlighting based on their content or syntactical meaning. The editor has been setup to work with the SAS language. If you don't like our choices for colors, fonts etc. you can change them. Select the menu item Tools-Customize-Colors. In the Color dialog select the color template SAS. If you wish to regroup keywords (you want the data keyword treated like the proc keyword) select from the menu Tools-Customize-Languages. Select the SAS language. The keyword lists are at the top of the panel. You can now move keywords from one list to another. Keywords must be blank separated and contain only alphanumeric characters. The rest of this section lists the syntactic groupings and their characteristics.

Group

Style

Examples

The keywords, functions, and procedures are in bold typeface and broken up by color in the following groups.    

Executable statements

bold, blue

data, do, if, put

Declarative statements

bold, red

array, by, drop, label

Procedures

bold, green

sort, dataset, table, print

Functions and operators

bold, dk purple

max, date, ranuni, eq, lt

The comments are broken into the following groups.    

Open close

green, italic

/*a comment*/

End of line 1

green

* in col 1

End of line 2

dark blue, italic

/ in col 1 - used for JCL in the file.

The Rest of the syntax.    

Quoted strings

italic, red

'abcd' "efgh"

Numeric text

dk purple

4, 9.35, 88

Symbols

pink, bold

+, -, /, ;

Back to the top


Commenting

The commenting section includes features that allow you to quickly comment out a block of code, then return it to normal, create block comments, and quickly add prologs and other maintenance information.

Comment Un comment

You can comment out a block of code by selecting it with the mouse, and invoke the Comment Un comment menu item from the Comment Block Commands selection of the context sensitive menu. This function can also be invoked by pressing the Com Out button from the SAS toolbar. Any comments within the block of code are altered to prevent them from effecting the commented out block.

This conversion is easily removed by using the same function on that block of code again. If you have previously used this function on a block of code, you can remove the comment blocking. The comments will be removed and any contained comments will be returned to their original form.

Conversion of a Block of lines with Comment Un comment:

data temp2;
  set temp;
  if x > 11;  /* this is important */
run;

After:

       /***# Comment Out Start **************************
data temp2;
  set temp;
  if x > 11; \* this is important *\
run;
       **************************** Comment Out End #***/

Single Line Block Comments

You can create a small comment box around a single line with the comment block single line edit macro. You can invoke this macro through the Comment Block Current Line selection off the Comment Block Commands submenu of the (right click) context sensitive menu. Or you can use template expansion, pressing the Block Line button on the SAS toolbar, or by running the macro cbline (SAS^cbline from a non *.sas file). When used through the context sensitive menu or the Macro-Run menu the cursor must be on the line containing the comment. When using template expansion just type cbl followed by a space at the end of the line.

The first character on the current line determines where the comment symbol begins if that character is in column 1 through 4. If the first character is beyond column 4, then the comment's first "/" begins 3 positions to the left. This is done to prevent a "/" from occurring in column 1, which would cause problems if the SAS code is included in a JCL stream. A before and after example of the operation is shown below.

Before:
run;
          Sort the new data!|
proc sort data=indata.mystuff;
 by var1;
run;
After:
run;
          /**********************/
          /* Sort the new data! */
          /**********************/
proc sort data=indata.mystuff;
 by var1;
run;

Block Comments

You can create a comment box around a block of lines with the comment block edit macros. You can invoke these macros through the (right click) context sensitive menu with Comment Block Selected Text off the Comment Block Commands submenu. You can also press the /* Block button (or /** Block , /*** Block) on the SAS toolbar. You can also use the template expansion (if you have persistent blocks set on), or by running the macro cbit (SAS^cbit from a non *.sas file), cbit2 or cbit3 . When used through the context sensitive menu or the Macro-Run menu you must have the comment lines selected as a block. All the comment block functions are listed in the sub menu of the context sensitive menu selection Comment Block Commands. When using template expansion just type cbk followed by a space (or cbk2, cbk3 ) at the end of the selected block. Note, you must have persistent blocks turned on (Block-Persistent blocks menu) to use the template expansion method.

The starting position (column) and length of the first line determine where the comment box starts and the total width of the box. The position of the subsequent line is not relevant. All the text in the selected block are word wrapped to fit into the comment box with a blank on the left margin and left justified. Note that all duplicate blanks are eliminated from the selected text before it is fit into the box. A before and after example of the operation is shown below.

Before:
run;
                  This is a very critical part
                      of my overly important program. (I feel that
                          the usefulness
                              of
                                  the
                                      program is highly under rated.)
proc sort data=indata.mystuff;
 by var1;
run;
After:
run;
                  /*************************/
                  /* This is a very        */
                  /* critical part of my   */
                  /* overly important      */
                  /* program. (I feel that */
                  /* the usefulness of the */
                  /* program is highly     */
                  /* under rated.)         */
                  /*************************/
proc sort data=indata.mystuff;
 by var1;
run;

You can create larger blocks by placing more blanks before the last word in the first sentence of the text to be comment blocked.

Before:
run;

        This is a much larger comment                   block
            but is still important
proc sort data=indata.mystuff;
 by var1;
run;
After:
run;

        /**************************************************/
        /* This is a much larger comment block but is     */
        /* still important                                */
        /**************************************************/
proc sort data=indata.mystuff;
 by var1;
run;

Back to the top


Quick searches

Quick searches allow you to find, somewhere else in the file, words or phrases that you can highlight on the current line. You can find all occurrences or just the next one up or down in the code. Its as easy as selecting some text and clicking a button.

Find Selected Item

Three macros are available to find an item that you have selected. Two of the macros move your cursor to the next or last occurrence of the selected text. The third finds all occurrences and lists them in the Search List (bottom of edit screen). These macros are executed from the context sensitive menu or through key combinations.

Find All (Global)

Select Find Selected Text -Find All , press SAS toolbar button "Magnify Glass + Document" , or press Cntl-Shft-m to find all occurrences of the currently selected string. The menu selection is located under the Tools menu item of the SAS context sensitive menu. Find Selected Text is located on the primary context sensitive menu while in LOG files. After you invoke the macro all occurrences of the string in the current file are listed in the Search List. You can hop to that line by double clicking it in the Search List.

Find Forward (Next)

Select Find Selected Text -Find Forward , press SAS toolbar button "Magnify Glass + Right arrow" or press Cntl-Shft-n to find the next occurrence of the currently selected string. The menu selection is located under the Tools menu item of the SAS context sensitive menu. Find Selected Text is located on the primary context sensitive menu while in LOG files. After you invoke the macro the cursor is moved to the next occurrence of the selected string. The string is highlighted, allowing you to invoke the macro again, or replace the text.

Find Backward (Last)

Select Find Selected Text -Find Backward , press SAS toolbar button "Magnify Glass + Left arrow" or press Cntl-Shft-b to find the prior occurrence of the currently selected string. The menu selection is located under the Tools menu item of the SAS context sensitive menu. Find Selected Text is located on the primary context sensitive menu while in LOG files. After you invoke the macro the cursor is moved to the previous occurrence of the selected string. The string is highlighted, allowing you to invoke the macro again, or replace the text.

 

Back to the top

Jump to: Editing features, Templates, SAS Integration and Debugging and Smart Code. Or, look at the EZRTools;) manual.

 

Download a trial copy of EZRTools;)

Download a trial version of Multi-Edit.



Home : About Us | Links | Site Map | News Releases | Contact Us
Support : Tips and Hints | Downloads and Patches | Manual | FAQs | Newsletters | Bug Reports | Suggestions
Products : Overview of Features | Features | Screen Shots | Free Trial | Purchase | Lite Version

EZRTools created by Martin Works, Inc.

50 Myrtle Street, Susquehanna, PA 18847 570-396-3121




Copyright © 2000-, Martin Works Inc., Text, graphics, and HTML code are protected by US and International Copyright Laws, and may not be copied, reprinted, published, translated, hosted, or otherwise distributed by any means without explicit permission. SAS® is a registered trademark of SAS Institute, Inc. in Cary, NC. Multi-Edit® is a trademark of Multi-Edit Software Inc. All other logos and trademarks in this site are property of their respective owners.