As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Errors, Warnings, and Notes (Oh My): A Practical Guide to Debugging SAS® Programs

From sasCommunity
Jump to: navigation, search
Susan J. Slaughter, University of California Extension, Davis, CA
Lora D. Delwiche, IT/ANSA, University of California, Davis, CA

Why a paper on debugging SAS programs?

Most of the documentation about the SAS System doesn't even mention bugs, as if debugging wasn't worth talking about. This paper, on the other hand, is based on the belief that debugging is a good way to get insight into how SAS works. Once you understand why you got an error, you'll be better able to avoid it in the future. In other words, people who are good debuggers are good programmers. Bugs can have different origins; some are accidentally built into the software by developers, others are introduced by programmers. Recently, one of the authors of this paper had a conversation about this topic with her father who is an aerospace engineer but not knowledgeable about the SAS System. The conversation went like this:

Susan: I’m writing about how to debug SAS programs.
Father: I thought they would have gotten the bugs out of SAS by now.

Fortunately, SAS Institute has done a good job of getting the bugs out of SAS software. Unfortunately, nobody has yet figured out how to get the bugs out of people.[1]

The SAS System even fixes some mistakes made by programmers. For example, SAS has gotten so smart over the years that it is now almost impossible to get an error by misspelling a keyword. If you misspell a keyword in a SAS program, SAS will almost always figure out what you meant to say and run the statement correctly in spite of your poor typing skills. But SAS can't fix all programming errors, so this paper discusses some of the most common bugs and how to exterminate them.

Online materials


  1. "Debugging Myself" by Hayes (1995) contains an entertaining discussion of human bugs.