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 (March 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: lpogoda@AOL.COM
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.]


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