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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!