Thursday, July 15, 2010

Adding Abbreviation in SAS

I am a bad typer. And I have a short term memory loss. Remembering the syntax, typing a lot of code (especially the repeating ones)... Na... Not my cup of tea..

SAS Enterprise Guide (4.1 onwards) has come up with a one shot solution for people suffering from my kind of syndrome - Adding Abbreviation.

Here is how you can go about it:
  • Open a new code window in SAS EG
  • Go to Code -> Add Abbreviation
  • You get a window where you can add the abbreviation and the text which needs to be substituted for the Abbreviation used. See the example below:

Here, I have a requirement of using my passthrough syntax every now and then and I tend to forget the syntax, password and sometimes even my user name :-)

So.. I use the Abbreaviation 'Pr' and enter the text (rather Copy & Paste) as shown in the above image. Click Ok.

Next time you would want to enter the code, just type Pr and you get a prompt (Yes... à la Visual Studio IDE)

Now, hit the tab or press Enter and you have the code on your Screen!

You can also edit your Abbreviation by going to Code -> Editor Macros -> Macros. Select the required macros (if any) and Click on Edit.

1 comment: