Date: Thu, 4 Mar 1999 12:08:38 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: pimpy question
Content-Type: text/plain; charset=US-ASCII
LPogoda <lpogoda@AOL.COM> wrote:
>In article <19990208154453.04739.00000192@ng-cg1.aol.com>, dnordlund@aol.com
>(DNordlund) writes:
>
>>the explanation is that the syntax TOTAL+COST implicitly RETAINS the variable
>>TOTAL. Therefore,
>>
>>TOTAL+COST;
>>
>>is equivalent to
>>
>>RETAIN TOTAL;
>>TOTAL=TOTAL+COST;
>
>Which is documented in the manual. Check out the SUM statement.
A better equivalent is
retain total .;
total = sum(total, cost);
The Language and Procedures manual does a better job of explaining it than does the Language Reference manual. The L&P implies that it is internally implemented as
retain total .;
if cost ne . then
total = sum(total, cost);
which is turn is the equivalent of
retain total .;
if cost ne . then
if total ne . then
total = total + cost;
else
total = cost;
--
JackHamilton@FirstHealth.com
West Sacramento, California
[We have had mailer problems recently; if mail to this
address bounces, please wait a day and try again.]