Friday, April 13, 2012

How to Create a SAS Shortcut: Assigning a Series of SAS Commands to One Keystroke

  1. Open the Enhanced Editor window within SAS®.
  2. From the toolbar, select Tools --> Options --> Keys.
  3. Scroll down to the keystroke you would like to assign to the series of commands, looking for a keystroke that has no assignment.  For example, scroll down to F12.
  4. Add the command code under the Definition heading
            For example: log; clear; output;clear;odsresults; clear; wpgm; submit;
  5. Close the Keys window.

Now, pressing the assigned keystroke will perform the assigned set of commands. The keystroke is available in the Log, Output and Enhanced Editor windows

Notes about creating SAS shortcuts:

  • If there are multiple editor windows open, the keystroke will resubmit code for the editor window that the user is currently in.
  • If there are multiple editor windows open and the user is not in an editor window, the keystroke will submit whatever program code that is highlighted.
  • If no program code is highlighted, the keystroke defaults to the first editor window.
  • This assignment will remain until it is changed or deleted.  (The shortcut is retained even when you close/open your SAS® session).

No comments:

Post a Comment

Please feel free to contact or comment the article

Search This Blog