Do you have SAS/ETS? If so, look into PROC EXPAND. If you don’t, there are also some links here on how to do that with a data step.
If you search on here, this has been asked at least twice this year so far and there are answers on here as well.
https://blogs.sas.com/content/iml/2016/01/27/moving-average-in-sas.html
... View more