Thank you udo@sas. I couldn´t really start with this after returning from my vacation, but now I can find some time and I have already found some use of your answer. However I'm not there yet. I think I don't need your kind of data step because I already have a date variable manad (YYMMN6. 200801-201812) and of course my variable of interest SGI_ROD_FP_ANDEL (with values from 200801 until 201405). When writing my proc timedata step I'm doing like this: proc timedata data=have out=_null_ outarray=want; id manad interval=MONTH; var SGI_ROD_FP_ANDEL; outarray movavg; do 1 to _LENGTH_; movavg =(SGI_ROD_FP_ANDEL[t-12]+SGI_ROD_FP_ANDEL[t-24]+SGI_ROD_FP_ANDEL[t-36])/3; end; run; Then I got movavg values from 201101 until 201505. My objective is however to get values from 201406 until 201812. Hence I want moving average values that depend of a mix of SGI_ROD_FP_ANDEL values and movavg values and some that only depends of movavg values. Is that possible? When I substitute "_LENGTH_" for something else, it simply doesn't work. What I'm doing wrong?
... View more