Hello @novinosrin. Thank you for the reply. Here is the code I used to generate the subset of PROC PRINT shown below. But what I want is the ihdi value at obs=8 to fill in obs=9 and 10, the last year for ctryno=1. I also want ihdi=0.311 at obs=21 to fill in obs=22. Similarly throughout the data file. Thanks again. data want; retain country code year ctryno; set have; by ctryno year; retain _ihdi; if first.code then call missing(_ihdi); if not missing(ihdi) then _ihdi=ihdi; else ihdi=_ihdi; drop _ihdi; proc print data=want; var code ctryno year ihdi hdi;
... View more