Totals values of numeric variables.
SUM variable(s) </ STYLE
<(location(s))> =<style-element-name><[style-attribute-specification(s)]>>;
|
- variable(s)
-
identifies the numeric variables to total in the report.
- STYLE
<(location(s))>=<style-element-name><[style-attribute-specification(s)]>
-
specifies the style element to use for cells
containing sums that are created with the SUM statement. For information about
the arguments of this option and how it is used, see STYLE in the PROC PRINT statement.
Tip: |
To specify different style elements for
different cells reporting sums, use a separate SUM statement for each variable
and add a different STYLE option to each SUM statement. |
Tip: |
If the STYLE option is used in multiple
SUM statements that affect the same location, the STYLE option in the last
SUM statement will be used. |
When you use a SUM statement and a BY statement with one BY variable,
PROC PRINT sums the SUM variables for each BY group that contains more than
one observation and totals them over all BY groups (see Summing Numeric Variables with One BY Group).
When you use a SUM statement and a BY statement with
multiple BY variables,
PROC PRINT sums the SUM variables for each BY group that contains more than
one observation, just as it does if you use only one BY variable. However,
it provides sums only for those BY variables whose values change when the
BY group changes. (See Summing Numeric Variables with Multiple BY Variables.)
Note: When the value of a BY variable changes, the SAS System considers
that the values of all variables listed after it in the BY statement also
change. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.