O'Reilly logo

PROC TEMPLATE Made Easy by Kevin Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining a Table

You have already seen in previous chapters how to render some simple table templates, but let’s recap the methods here to refresh our memories. The first method works with all versions of SAS that have ODS. It uses PROC TEMPLATE to define the table. The DATA step is then used to bind a data set to that template to create the tabular output. The code below is the simplest table template that you can create. It simply prints out all columns of the data set using all of the default attributes.

PROC TEMPLATE;
DEFINE TABLE mytable;
END;
RUN;

DATA _NULL_;
  SET sashelp.class(OBS = 10);
  FILE PRINT ODS = (TEMPLATE = “mytable”);
  PUT _ODS_;
RUN;

Here is the output from the code above.

The DATA _NULL_ statement won’t change in most of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required