|
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
> ----------------------------------------------------------------
|