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

Using Computed Column Values As Column Data

Although you do need a data set to render a table template, you do not necessarily need a data column for each column in the table. You can create columns that are computed from other data in the table. These are called “computed columns.” The COMPUTE AS statement determines whether a column is associated with a data column or an expression. This statement takes a standard expression as its argument. The expression is evaluated for every observation in the input data set to get the resulting output data value. Here is the general format of the compute as statement:

COMPUTE AS expr;

Since we have been using the Sashelp.Class data set, let’s continue that trend and use that information to compute something ...

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