There are not different rules for each ID. I have 7 variables to indicate day (day1-day7). For the last.id, each person could have at least one missing and up to 7 missing values for these day variables. For example: ID=1 might have missing values for day4-day7 in last.id. But ID=2 might have missing values for day2-day7. Then there are corresponding varaibles to the days that describe peoples drug use on those days. For instance: ID=1 would have a 1 or 0 for druguse1-druguse3 but missing values for druguse4-druguse7 in last.id, corresponding to the missing values for the days. ID=2 the missing values in last.id would be druguse2-druguse7. Because there are so many variables, I was hoping to fill down to row 5 from row above (row 4) if variables are missing using this code: data want; update have (obs=0) have; by id; output; run; Then I was thinking it may be possible to delete all the values that filled down from row 4. Then fill down from row 3 to rown 4, delete values from row that that went down... and so on. The missing values would end up in first.id instead of last.id. If this logic will not work, then please let me know, and I can find another way.
... View more