Chapter Contents |
Previous |
Next |
The COMPUTAB Procedure |
In addition to the variables and observations in the input data set, you can create additional rows or columns by using SAS programming statements in PROC COMPUTAB. You can
The following statements add one computed row (SUM) and one computed column (TOTAL) to the report in Figure 9.5. In the input block the logical operators indicate the observations corresponding to each column of the report. After the input block reads in the values from the input data set, the column block creates the column variable TOTAL by summing the columns A, B, and C. The additional row variable, SUM, is calculated as the sum of the other rows. The result is shown in Figure 9.6.
proc computab data= report; rows travel advrtise salary insure sum; columns a b c total; a = compdiv = 'A'; b = compdiv = 'B'; c = compdiv = 'C'; colblk: total = a + b + c; rowblk: sum = travel + advrtise + salary + insure; run;
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.