Did you know that you can define "abbreviations" in the SAS enhanced editor? These handy little shortcuts can save you a lot of typing. For example, I have an abbreviation for the string _iml. Whenever I type _iml, the editor prompts me to replace those four characters with the following SAS/IML template:
proc iml; use <dataset>; read all var {A B}; close; quit; |
I can also define a keystroke that inserts the abbreviation. For example, I can define CTRL+I to insert the preceding code snippet.
To learn more about defining abbreviations in the SAS enhanced editor, see the paper "SAS Abbreviations are your friends, use the template method to code!" by Elizabeth Ceranowski. A paper by Mary Rosenbloom and Kirk Paul Lafler describes how to assign your abbreviation to a function key.
8 Comments
This will be very handy. Another useful shortcut can be used to comment / uncomment a few lines of code. Highlight the lines of code, and press CTR+/ to comment or CTRL+SHIFT+/ to uncomment.
This comment/uncomment shortcut would be very handy indeed. Any idea how to implement this? I suppose it's a bit more complicated than inserting a piece of code...
It's already implemented. The SAS Enhanced editor has a number of keyboard shortcuts built in, and CTRL+/ and CTRL+SHIFT+/ are just two of them.
To see all the pre-defined keyboard shortcuts, bring up the SAS Windowing Environment (formerly known as SAS Display Manager). Select Tools-->Keyboard Macros-->Macros. Click Assign Keys. This brings up the Assign Keys dialog box.
If you choose "Selection Operations" from the Categories menu, you will see the comment/uncomment commands, and the keys that they are currently mapped to. If you choose "All" from the Categories menu, you can se all options and key bindings.
This is all pretty well hidden, don't you think?
If you use SAS Enterprise Guide 4.3, all of these features are more integrated and more obvious...including the use of abbreviations and the hundreds of commands that you can use within the editor. See my post at the SAS Dummy blog for more information.
Pingback: Abbreviation for GTL boiler plate
This abbreviation feature has relieved a nagging pain while creating simple graphs using GTL. See my post on a GTL boiler plate.
Pingback: This week in blogs: abbreviations, innovation and the holidays - SAS Voices
Pingback: Take SAS program editor abbreviations to the next level - The SAS Dummy