Sum Statement
The following program is submitted:
data all_sales;
infile 'file-specification';
input receipts;
<insert statement(s) here>
run;
Which statement(s) complete(s) the program and produce(s) a running total of the Receipts variable?
a. total+receipts;
b. total 0;
sum total;
c. total=total+receipts;
d. total=sum(total,receipts);
答案:a
SAS中sum statement语句表达式,total+receipts;初始total为0,然后累加。
Here are examples of sum statements that illustrate various expressions:
balance+(-debit);
sumxsq+x*x;
nx+(x ne .);
if status='ready' then OK+1;