Okay how many times has this happen to you. You write a statistical program for class. The code is beautiful. You get results. Then the semester ends and you decide to archive the program. Job well done. A+. Months later, you get a similar project and you open up your master piece… What in the world? There are sections of the code that look very complicated and you can not remember why you did it. As a matter a fact, it’s like a you didn’t code it at all. Who wrote it? The problem is you did and your memory went blank.
As you write a statistical program, like SAS, you need to include comments throughout the program. I typically include the author name, description, and date in a comment field. Then I put comments throughout the program to decode what is happening at each step. So for instance, we have the following code:
“libname amy “C:\”; *library reference named Amy;
which represents the library reference named Amy according to the comment in bold font. In SAS, comments are added by putting an asterisk in front of the comment and a semi-colon at the end of the comment.
So don’t forget your comments.
If you enjoyed this blog there are more to come-Amy