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 2000, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 30 Mar 2000 10:22:01 -0800
Reply-To:   Ya Huang <ya.huang@AGOURON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ya Huang <ya.huang@AGOURON.COM>
Subject:   Re: Merge, why I can't turn off the default retain?
Comments:   To: John Whittington <John.W@MEDISCIENCE.CO.UK>
Content-Type:   text/plain; charset=us-ascii

Thank you very much, Dr. Whittington, I never thought I can (should) put something before merge statement, now I learned something new.

Thanks

John Whittington wrote:

> At 10:04 30/03/00 -0800, Ya Huang wrote (in part): > > >data xx_h (rename=(y=ny)); > > set xx; > >by x; > >if first.x then delete; > >else output; > > > >data xx; > > merge xx(in=a) xx_h(in=b); > >by x; > >if a and not b then ny=.; /**********/ > > > >Question is why I still get ny retained in obs=5,10? > >I expected after using the "if a and not b then ny=." statement, > >ny would be missing in obs=5,6. But as you can see, > >they are still retained. Can somebody tell me why? > > Ya Huang, *any* variable which comes from a dataset which is SET, MERGEd, > UPDATed etc., is automatically RETAINed. If you want to disable that > functionality, you should put a ' ny = . ; ' satement immediately before > your merge statement. > > Kind Regards > > John > > ---------------------------------------------------------------- > Dr John Whittington, Voice: +44 (0) 1296 730225 > Mediscience Services Fax: +44 (0) 1296 738893 > Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk > Buckingham MK18 4EL, UK mediscience@compuserve.com > ----------------------------------------------------------------


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