summing up the columns

Reply
Frequent Contributor
Posts: 102

summing up the columns

hi i have a column

name count

a          1

b          0

c          0

d          1

e          1

i want to arrive at sum= 3, which counts the 1s.

thank you!

Respected Advisor
Posts: 3,786

Re: summing up the columns

PROC SUMMARY

RTM.

Trusted Advisor
Posts: 1,228

Re: summing up the columns

data have;
input name $ count;
datalines;
a          1
b          0
c          0
d          1
e          1
;

proc tabulate data=have;
var count;
table count,sum;
run;

Ask a Question
Discussion stats
  • 2 replies
  • 174 views
  • 0 likes
  • 3 in conversation