The Enhanced Editor in SAS allows you to save a series of keystrokes as keyboard macros. A special form of these macros is keyboard abbreviation. The abbreviation allows you to recall stored code with a minimum of keystrokes. In the example that follows, these keystrokes form the outline of a header section of comments for a SAS program.

By using an abbreviation, we will only need to type this code once. E.g. the following comment is to be
inserted into the top of each SAS program that you write.

Project : The project name
Program :
Version : Version Number
Purpose : Brief description of the code and its purpose
Author : Name of the author
Date : Date of creation of the code
Sub Macros : Names of macros if used
Reviewer : Name of the reviewer
Notes : Any notes or remarks about the code
To add this header as an abbreviation, select the pull down menus Tools and Add Abbreviation.

The Add Abbreviation dialog box is then displayed (see below). In the first dialog space, enter a name for the new abbreviation. This becomes a keyboard macro, so you must select a name that has not already been used. Then type (or more practically paste) the substitution text into the ‘Text to insert for abbreviation’ dialog space and press Ok.

Whenever you want to use an abbreviation, simply type in the name of the abbreviation while in the Enhanced Editor. As soon as the last letter of the abbreviation has been entered, a small pop-up ‘tip’ text box containing the first few digits of the abbreviation is displayed. If at that point you press the TAB key the name of the abbreviation will be replaced by the text that you stored.
The following screen shot shows that the name of the HEADER abbreviation has been entered in the Enhanced Editor and the first few characters of the text to be substituted is shown in the pop-up ‘tip’ box.

As soon as you press the TAB key the abbreviation name is replaced by the stored text.

  1. gravatar

    # by Santosh - November 30, 2011 at 3:26 PM

    The blog was absolutely fantastic! Lots of great information and
    inspiration, both of which we all need!b Keep 'em coming... you all do
    such a great job at such Concepts... can't tell you how much I, for
    one appreciate all you do!

  2. gravatar

    # by Analyst - April 16, 2012 at 11:55 PM

    Thanks for the appreciation Santosh!

  3. gravatar

    # by Sunil Kumar - December 14, 2013 at 4:34 PM

    How to get page no's like 1/10,2/10,3/10,4/10....10/10 in sas listings .

Blog Widget by LinkWithin

Search this blog..