AD10
A Data-Driven Macro Automating the Data Presentation Process by Generating Tailored, Customizable SAS Code: Relax, let %TABGEN do your work!

John Morrill, Quintiles, Inc.
Kristi Wiser, Quintiles, Inc.
Jay Zhou, Quintiles, Inc.

In many clinical trials it is useful or even required, perhaps for quality control purposes, to generate a selected data printout of desired variables in any/all datasets for a given directory. This paper presents a simple-to-use yet feature-laden macro d esigned to lighten this time-consuming task. The macro, %TABGEN, generates for each dataset an independent SAS program containing a tailored, customizable PROC REPORT. %TABGEN gleans dataset attributes using PROC SQL and SCL functions to generate a detai led DEFINE statement with appropriate width, format, and label information for each variable. %TABGEN allows sub-setting, the global dropping or keeping of variables, and the specification of ID and order status as well as line and page break variables. Several header, report type, and directory specification options are also available, and empty datasets are processed to show dataset structure. %TABGEN produces auxiliary files containing set-up information and code to run all tabulations together. %TAB GEN is robust across multiple platforms. This utility is a valuable tool for both beginner and expert, and the material is presented with this range in mind.