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 ...