Date: Thu, 21 Oct 2004 10:13:04 -0400
Reply-To: Solomon Anchen <solo_in@REDIFFMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Solomon Anchen <solo_in@REDIFFMAIL.COM>
Subject: Time sequence data processing
Hi ,
Here is what i am trying . Below is the input dataset.
data test;
input qt time8. price;
datalines;
09:37:03 34.5
09:38:40 34.5
09:39:30 34.48
09:43:21 34.5
09:45:32 34.51
09:50:31 34.5
09:54:32 34.52
09:56:34 34.51
09:59:09 34.52
;
run;
for each observation i would like the subsequent higher price .Below is the
expected output.
expected results:
qt price nxt higher price nxt higher price time
09:37:03 34.5 34.51 09:45:32
09:38:40 34.5 34.51 09:45:32
09:39:30 34.48 34.5 09:43:21
09:43:21 34.5 34.51 09:45:32
09:45:32 34.51 34.52 09:54:32
09:50:31 34.5 34.52 09:54:32
09:54:32 34.52 default value default value
09:56:34 34.51 34.52 09:59:09
09:59:09 34.52 default value default value
This is just a sample , the actual input dataset has roughly 20 million
observations , so performance is paramount in a situation like this.
Thanks,
Solomon