Date: Mon, 20 Aug 2007 19:40:21 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Subtracting 2 variables
In-Reply-To: <1187638376.158603.13580@m37g2000prh.googlegroups.com>
Content-Type: text/plain; format=flowed
RightDiff = Sum( A , -B , 0 ) ;
Toby Dunn
Two wrongs are only the beginning.
Success always occurs in private and failure in full view.
Experience is something you don't get until just after you need it.
From: tanwan <tanwanzang@YAHOO.COM>
Reply-To: tanwan <tanwanzang@YAHOO.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Subtracting 2 variables
Date: Mon, 20 Aug 2007 12:32:56 -0700
When adding, using '+' may produce wrong results (if some obs are
missing), so one may use the SUM function. Is there a fuction
equivalent to SUM for subtracting, that can handle missing data? As
in:
data;
input a b;
wrong_sum = a+b;
right_sum=sum(a, b);
wrong_diff=a-b;
cards;
1 2
.. 9
7 .
;proc print;
run;
I would like to have the right_diff as -1, -9 and 7
_________________________________________________________________
Tease your brain--play Clink! Win cool prizes!
http://club.live.com/clink.aspx?icid=clink_hotmailtextlink2