```Date: Tue, 7 Dec 2010 09:23:09 -0500 Reply-To: Arthur Tabachneck Sender: "SAS(r) Discussion" From: Arthur Tabachneck Subject: Re: how to solve this senario? Comments: To: Shaik Hymad I'm not sure why you would want to do what you ask but, if I understand what you are asking for, no retain is needed. Would something like the following suffice: data want; set have (where=(text eq 'x')); output; text='b'; output; text='z'; output; run; proc sort data=want; by patid text text2 vrd; run; HTH, Art --------- On Tue, 7 Dec 2010 09:00:11 -0500, Nway wrote: >Hi All, > > I have data like > > Patid text text2 vrd val > 1 b s 0 . > 1 b s 1 . > 1 b s 2 . > 1 b u 0 . > 1 b u 1 . > 1 b u 2 . > 1 x s 0 23 > 1 x s 1 23 > 1 x s 2 23 > 1 x u 0 12 > 1 x u 1 12 > 1 x u 2 12 > > >I need out put like > >Patid text text2 vrd val > 1 b s 0 . > 1 b s 1 . > 1 b s 2 . > 1 b u 0 . > 1 b u 1 . > 1 b u 2 . > 1 x s 0 23 > 1 x s 1 23 > 1 x s 2 23 > 1 x u 0 12 > 1 x u 1 12 > 1 x u 2 12 > 1 z s 0 . > 1 z s 1 . > 1 z s 2 . > 1 z u 0 . > 1 z u 1 . > 1 z u 2 . > > > > HOw to retain a value before and after text2 variable wise? > > I want output like this. > > Patid text text2 vrd val > 1 b s 0 23 > 1 b s 1 23 > 1 b s 2 23 > 1 b u 0 12 > 1 b u 1 12 > 1 b u 2 12 > 1 x s 0 23 > 1 x s 1 23 > 1 x s 2 23 > 1 x u 0 12 > 1 x u 1 12 > 1 x u 2 12 > 1 z s 0 23 > 1 z s 1 23 > 1 z s 2 23 > 1 z u 0 12 > 1 z u 1 12 > 1 z u 2 12 > > >Thanks, >Nway ```

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