From: Al on 13 Apr 2010 00:41 Dear All: I have the folowing dataset Patno Week1 Week2 week3 x 1 10/01/2008 10/11/2008 . 10/11/2008 2 10/02/2008 10/16/2008 10/24/2008 10/24/2008 3 10/03/2008 10/17/2008 . 10/17/2008 4 10/04/2008 . . 10/04/2008 I want to create a variable x with last know date for every patno using arrays or any other data step method Thanks in advance Al
From: Chris Jones on 13 Apr 2010 04:11 On 13 Apr, 05:41, Al <ali6...(a)gmail.com> wrote: > Dear All: > > I have the folowing dataset > > Patno Week1 Week2 week3 x > 1 10/01/2008 10/11/2008 . 10/11/2008 > 2 10/02/2008 10/16/2008 10/24/2008 10/24/2008 > 3 10/03/2008 10/17/2008 . 10/17/2008 > 4 10/04/2008 . . > 10/04/2008 > > I want to create a variable x with last know date for every patno > using arrays or any other data step method > > Thanks in advance > Al Try something like this (takes into account multiple records of same patno's) data outdat ; set indat ; by patno ; retain maxdate . ; if first.patno then maxdate = . ; maxdate = max(maxdate , max(of week:)) ; if last.patno then do ; x = maxdate ; output ; end ; run ;
|
Pages: 1 Prev: SAS AF question Setting the font on a TextEntry field in code Next: installing 64 bits |