Hello Laasse - Yes, my data step was only used for creating an example data set. I have modified your code to address your additional question (see below). Thanks, Udo proc timedata data=have out=_null_ outarray=want; id manad interval=MONTH; var SGI_ROD_FP_ANDEL; outarray movavg; do t = 1 to _LENGTH_; movavg =(SGI_ROD_FP_ANDEL[t-12]+SGI_ROD_FP_ANDEL[t-24]+SGI_ROD_FP_ANDEL[t-36])/3; if missing(SGI_ROD_FP_ANDEL ) then SGI_ROD_FP_ANDEL =movavg ; end; run;
... View more