SAS : Filling missing values with the previous value
Our purpose is simple. We try to fill missing values (.) with previous values with or without grouping like the following figure.
SAS code
The following SAS code fill missing values of coupon and rate fields with their previous values. In this example, as key columns are date and accno, a sorting is necessary. If the number of key column is one, there is no need to sort.
Period.
No comments:
Post a Comment