TT12
Bulletproofing and Knowledge Encapsulation in Statistical Macros

John K Troxell, Merck & Co., Inc.


Most SAS programmers agree that SAS macros are a wonderful tool for automating repetitive tasks. More controversial is bulletproofing (making a macro robust to incorrect parameters or data). Less commonly considered is the potential that macros offer for delivery of statistical expertise. Statistical knowledge can be built into macros with advanced rules for validating macro parameter values, implementation of good statistical practice, implementation of otherwise unavailable statistical methods, or deli very of data-driven advice and interpretation in English. Pros and cons of bulletproofing and knowledge encapsulation are discussed, and some specific techniques are presented. Many of the techniques are useful in non-statistical macros as well. Example s are drawn from macros for stepwise regression analysis and analysis of covariance.