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 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 9 Mar 1999 20:17:08 +0100
Reply-To:     Bas Pruijn <bas.pruijn@CMG.NL>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Bas Pruijn <bas.pruijn@CMG.NL>
Subject:      Re: carrying data forward
Comments: To: John Whittington <medisci@POWERNET.COM>
Content-Type: text/plain

I think I simplified a little to much. I have overlooked the subject part. You're also right about the retain. Sorry for the reply without enough thought.

> -----Original Message----- > From: John Whittington [SMTP:medisci@POWERNET.COM] > Sent: Tuesday, March 09, 1999 5:57 PM > To: SAS-L@AKH-WIEN.AC.AT > Subject: Re: carrying data forward > > At 17:19 09/03/99 +0100, Bas Pruijn wrote: > > >data outfil; > > set infil; > > retain var1 var2 var3; > >run; > > Bas, unfortunately it's not as easy as that. All RETAIN does is stops the > variables being 'reset to missing' at the 'top' of each iteration of the > DATA step. The previous value will therefore only be RETAINed until such > a > time as a new value is assigned to the variable - in this case by the SET > statement - at which point the variable will acquire the 'new' value, no > matter what its value (even 'missing'). > > Furthermore, even if RETAIN did what you prtesumably thought it did, your > code would have potentially resulted in values being 'carried forward' > from > one subject to a totally different subject. I don't think there is any > simpler way of achieving what is needed than the code I posted recently. > > Kind Regards, > > John > > ---------------------------------------------------------------- > Dr John Whittington, Voice: +44 (0) 1296 730225 > Mediscience Services Fax: +44 (0) 1296 738893 > Twyford Manor, Twyford, E-mail: medisci@powernet.com > Buckingham MK18 4EL, UK mediscience@compuserve.com > ----------------------------------------------------------------


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