I'm having a problem with moving averages that I couldn't figure out any solution so far.
I need to calculate the moving average of the previous 6 months for 6 months. The thing is I want to include the previous calculated moving averages including the moving statistic.
I've tried doing it with LAG function and with PROC EXPAND, but it didn't work.

The X column is my original information, the Y1 is what i'm achieving (SAS considers M7 to M12 as missing) and the Y2 is what I want

M X Y1 Y2
M1 100,0 100,0 100,0
M2 200,0 200,0 200,0
M3 300,0 300,0 300,0
M4 400,0 400,0 400,0
M5 500,0 500,0 500,0
M6 600,0 600,0 600,0
M7 350,0 350,0
M8 400,0 391,7
M9 450,0 423,6
M10 500,0 444,2
M11 550,0 451,6
M12 600,0 443,5