Date: Fri, 6 Jan 2006 08:01:30 -0500
Reply-To: Kijoeng Nam <kijoeng@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kijoeng Nam <kijoeng@GMAIL.COM>
Subject: SAS Program.
Content-Type: text/plain; charset=ISO-8859-1
requirement to: compute the day interval of each
following visit from the first hospitalization.
=> I solved for one hospital x (if x = h)
if I want to get each different interval for diffrent haspital x How can I
to do?
-----------------------------------------------------------------------------------------
options formdlim=' ';
data t1; input enter $ 1-10 disc $ 12-21 x $ 23 id 25;
datalines;
01/07/2003 01/07/2003 g 2
02/07/2003 05/07/2003 h 2
06/07/2003 10/08/2003 k 2
01/09/2003 02/09/2003 h 2
05/10/2003 05/10/2003 k 2
01/07/2003 01/07/2003 g 3
02/07/2003 05/07/2003 h 3
01/08/2003 10/08/2003 k 3
01/09/2003 02/09/2003 h 3
05/10/2003 05/10/2003 k 3
;;
run;
data t2;
set t1;
if x='h';
*converting chracter to numeric;
in = input(enter,ddmmyy10.);
out = input(disc,ddmmyy10.);
run;
data t3; set t2;
by id;
if first.id then do;
Original_out= out ;
interval = .;
retain Original_out ;
End ;
else interval = in - Original_out;
run;