Using Generic Columns in a Table Template

Because ANNUALSALARY, BONUSAMT, and NEWAMT are all numeric variables in the data set HR, one approach for a custom table template might be to define a template that has only two items in the COLUMN statement: one for character variable DEPARTMENT and a second, generic column for the three numeric variables. The ability to define generic or reusable column items in your table template is a powerful feature of table templates. As we discussed previously, the default template used with the DATA step uses only two generic columns: one for numeric variables and one for character variables.

proc template; define table tables.hr_generic; column Department SalGen; dynamic colhdr; define Department; header='Dept'; ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.