The Sum Statement

A sum statement adds the results of an expression to an accumulator variable.

General form, sum statement:
variable+expression;

where

  • variable is a numeric variable
  • expression is any valid SAS expression.


     data perm.residnts;  
        infile census; 
        retain address;
        input Type $1. @;
        if type='H' then do;
           if _n_ > 1 then output;
           Total=0;
           input Address $ 3-17;
        end;
        else if type='P' then total+1;





Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement