Adding comments can make it much easier to remember important aspects of your code: what you're doing, why you're doing it and when you did it. Consistency in their appearance can add to the readability of these comments. Unfortunately, it's easy to skip over this crucial step.
The SAS Enhanced Editor contains a powerful keyboard macro feature that makes it simple to create the structure of consistently formatted comments. This paper will explore the creation of four keyboard macros to aid in documentation, that will execute with a single keystroke:
- adding a comment line
- adding a code change comment, with the current date automatically included
- commenting out a selected block of text, again with the current date included
- a program header
Note: the keyboard "macros" have nothing to do with the SAS Macro language.