Hi Astounding, Thank you so much for helping me solve this problem. The solution, in full, is: DATA want; set have; array HGC {1979:1989} HGC1979 - HGC1989; if (CYRB > .) then do _n_ = max(CYRB, 1979) to min (CYRB, 1989); HGCB = max(HGCB, HGC{_n_}); end; if HGCB = . and CYRB > 1979 then do _n_ = CYRB - 1 to 1979 by -1 until (HGCB > .); HGCB = HGC{_n_}; end; if CYRB < 1979 and HGCB = . then HGCB = HGC1979; RUN; To respond to your additional exploration, it was unnecessary for me to use the additional code you included at the bottom of your last answer because every participant with a date of birth prior to 1979 has a non-missing HGC1979 value. 1979 was the first survey year, and all participants already born (meaning they have a CYRB <1979) completed the survey in 1979. Thank you so much for all your help!! Now I can finally get on to the analysis! Best, Alanna
... View more