Date: Fri, 8 Aug 2008 08:05:36 -0700
Reply-To: "dc353@hotmail.com" <dc353@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "dc353@hotmail.com" <dc353@HOTMAIL.COM>
Organization: http://groups.google.com
Subject: missing values
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I have a dataset as follows:
DATE TICKER TNA
the dataset is sorted by TICKER DATE
There are no missing observations for either TICKER or DATE
Sometimes the first n observations for TNA are missing. If TNA is
missing for the first observation (for any TICKER) I need to replace
the missing value with the first non missing value for that TICKER.
I'd like to be able to do this with only going through the records
that I need to. Appreciate any suggestions.
example:
Date Ticker Tna
1 abc .
2 abc .
3 abc .
4 abc 5
5 abc 7
6 abc .
7 abc .
1 xyz 3
2 xyz .
need to convert to:
Date Ticker Tna
1 abc 5
2 abc .
3 abc .
4 abc 5
5 abc 7
6 abc .
7 abc .
1 xyz 3
2 xyz .