Date: Fri, 18 Jul 2003 11:28:25 -0700
Reply-To: Max <max8ca@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Max <max8ca@YAHOO.COM>
Subject: help
Content-Type: text/plain; charset=us-ascii
Hello there,
I have a dataset where one variable have some missing
value.
I want to replace the missing value with the value
above
it under the same LNUM. The original data is
ID LNUM clm
483 9048 J085
483 9943
483 2652 H915
483 2652
I need to create a new variable that takes the same
value for
CLM under the same LNUM, so the new variable looks
like:
ID LNUM clm clm2
483 9048 J085 J085
483 9943
483 2652 H915 H915
483 2652 H915
I tried to use RETAIN, but it assigns the value for
LNUM 9943,
which is not supposed to:
ID LNUM clm clm2
483 9048 J085 J085
483 9943 JO85
483 2652 H915 H915
483 2652 H915
My code is
data d2;
set d1;
by id lnum;
retain clm2;
if clm ne ' ' then do;
clm2=clm;
end;
run;
Any help would be appreciated.
Max
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com