Author: Linda Collins, Lisa Brooks, Michael Rea, Alan Hopkins
Date: Friday, June 10th, 2005
Presented at: Proceedings of the Western Users of SAS Software Conference

There’s an intrinsic tension between setting up an elegant, modular programming system and writing simple, easy-tounderstand programs. Macro libraries have enormous value as a production tool; they allow common applications to be written, validated, and reused easily. However, they often contain a great deal of obscure code designed to produce ‘pretty’ results. For some audiences – such as a statistician or regulatory reviewer who wants to verify that the desired procedures were coded correctly – a simple, straightforward program is preferable. The ideal program for this audience contains only the procedures necessary to produce statistical results (see CDISC Analysis Data Model Version 2.0).

In this paper, we present a technique for satisfying both needs. The framework is an application macro library that runs common SAS® statistical procedures and produces a finished report. A program run generates both a publication-quality statistical table and a simple program containing only the data pre-processing and statistical procedures. The generated code is executable as a portable, stand-alone program, which does not require access to the original macro library. The simplified code can be used for debugging, to verify correct use of the macro library, and as a record of the steps and procedures used to program the table.

Download