LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 16 Jul 2004 02:26:36 GMT
Reply-To:     julierog@ix.netcom.com
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Roger Lustig <trovato@VERIZON.NET>
Subject:      Re: sum
Content-Type: text/plain; charset=us-ascii; format=flowed

June:

Arrays might well be used, though

sum(of q1-q12)

is nice too.

However, I'm not sure what you're looking to do. Could you show us what the output data set would look like?

Best,

Roger

June wrote:

> Hi, > > I have a data set like below: > > Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Sum > 1 1 2 1 1 1 2 1 1 2 1 1 > 2 1 1 1 2 1 1 2 1 1 2 2 > 1 2 1 2 1 2 1 2 1 2 1 1 > 2 2 2 2 2 1 2 1 2 2 2 2 > 1 1 1 1 1 2 1 1 1 1 2 1 > 1 2 1 2 1 1 2 1 2 2 1 2 > 2 1 2 1 2 1 1 2 1 1 2 1 > 2 2 1 1 2 1 2 2 2 1 1 2 > > Q1 to q12 has two value(1,2), How could I calculate the sum by row when Q(i)=1? > Q(i)=2 can not be changed. > > Do you think array can be used ? > > Thanks.


Back to: Top of message | Previous page | Main SAS-L page