Hello @Avishaarky and welcome to the SAS Support Communities!
To keep it simple:
data want(drop=i);
set sales;
array x[100];
array y[100];
do i=3 to 98;
y[i]=mean(x[i-2],x[i-1],x[i],x[i+1],x[i+2]);
end;
run;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.