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 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 18 Jul 2005 04:02:07 -0400
Reply-To:     Jim Groeneveld <jim1stat@YAHOO.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim1stat@YAHOO.CO.UK>
Subject:      Re: RETAIN DO LOOP and IF ELSE END
Comments: To: Robert Slotpole <rslotpole@COMCAST.NET>

Hi Bob,

A slight, but not unimportant correction or addendum on FIRST and LAST:

The FIRST. and LAST. variable not only change if the variable changes value from the previous (FIRST) or next (LAST) record, but also if one of the variables specified in the BY after SET statement _before_ the concerning variable changes its value, even if the concerning variable doesn't. See the example output in my previous posting.

P.S. Tell us (the list) just in words what you would like to accomplish with you code. It may be more efficient to build something from scratch than correcting you code. How is StartShare calculated, and EndShare, and how do they relate to Date?

Regards - Jim. -- Y. (Jim) Groeneveld, MSc., Biostatistician, Vitatron b.v., NL Jim.Groeneveld_AT_Vitatron.com (replace _AT_ by AT sign) http://www.vitatron.com, http://home.hccnet.nl/jim.groeneveld

My computer always teaches me something new I thought I knew already.

[common disclaimer]

On Sun, 17 Jul 2005 19:38:35 -0700, rss <rslotpole@COMCAST.NET> wrote:

>Could someone tell me if this is correct: > >first.anything is tagged to the by statement. So if you don't have a >BY ANYTHING when you try to do an IF FIRST.ANYTHING you will get a >variable uninitialized. > >If that's true that the code in this thread now almost works. As >indicated before we change the by statement to BY TICKER DATE CASHBLOCK >and now everything seems to be ok except the RETAIN statement. Since >cashblock = 999 always the IF FIRST.CASHBLOCK is only true the first >observation. This should be dropping through to the next statement but >it isn't. Can anybody see what's missing? I've tried this with >cashblock different values for each observation and cashblock all the >same values. Both answers are the same but clearly they shouldn't be. >Something else must be going on.


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