I want to repeat the last observation for every ID
I have this table A
ID year EQ
1 1899 .
1 1900 5
1 1901 .
1 1902 .
2 2000 .
2 2001 4
2 2002 .
2 2003 5
I want this table
ID year EQ
1 1899 .
1 1900 5
1 1901 5
1 1902 5
2 2000 .
2 2001 4
2 2002 4
2 2003 5
I write this program
data joint1; set joint; retain lstv; if EQ ne "" then lstv=EQ; if EQ="" then EQ=lstv;
run;
however this program repeat the observation and does not care about id. it give me this. the 5 here is wrong it takes the observation of a bad id
ID year EQ
1 1899 .
1 1900 5
1 1901 5
1 1902 5
2 2000 5
2 2001 4
2 2002 4
2 2003 5
... View more