Create a Generic Macro to Produce Tables

If you regularly produce tables with a similar design, you can create a generic macro to simplify the table production process. This enables you to set up a basic format for titles, footnotes, row variables, and column variables and then to use it in all of your tables.
  1. Create the code. To produce this generic macro, you start by creating the basic PROC TABULATE code. This is the part of the code that does not vary between your tables. Just leave placeholders for the parts that will change from table to table, which will be filled in later by macro variables.
    PROC TABULATE DATA=TEMP;
       CLASS avar1 bvar2;
       VAR cvar3;
       TABLE var1,
          var2 *var3 *(dstat)*F=efmt
          / ROW=FLOAT BOX="ftext1";
    TITLE "gtext2"; RUN; ...

Get PROC TABULATE by Example, Second Edition 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.