Well, I'm guessing at some of the details of how your data are structured and what you are really looking for, but here's my best guess. The following DATA step creates 50 (instead of 500) data points that follow the model y = 3 + sin(x) + RANDOM_NOISE. Use whatever other model you want.
data have;
array x[5] x1-x5;
array y[5] y1-y5;
drop i;
call streaminit(12345);
do count = 1 to 50;
do i = 1 to dim(x);
x = i;
y = 3 + sin(x) + rand("Normal", 0, 0.2);
end;
output;
end;
run;
It sounds like you want to read in this data and fit a cubic spline to each observation. To do that,read the x1-y5 variables data into the matrix Z. For each row, use the SHAPE function and the T (transpose) function to reshape the row into a 5x2 matrix. Call the SPLINE function to fit the data on evenly-spaced grid of x values.
Save all the results and write it to a SAS data set so that PROC SGPLOT can graph it.
proc iml;
varNames = ("x1":"x5") || ("y1":"y5");
use have;
read all var varNames into Z;
read all var {"Count"};
close;
nout = 20; /* for testing, set NOUT small */
x = j(nrow(Z), nout); /* for storing results */
y = j(nrow(Z), nout); /* for storing results */
do i = 1 to nrow(Z); /* for each row */
v = shape(Z[i,],2); /* x is row 1 and y is row 2 */
xy = T(v); /* x is col 1 and y is col 2 */
call spline(fit, xy) NOUT=nout;
x[i,] = T(fit[,1]); /* store x values in i_th row of y */
y[i,] = T(fit[,2]); /* store predicted values in i_th row of y */
end;
/* Write data to data set; index each spline by ID var */
group = repeat(count, 1, nout);
create spline var {group x y};
append;
close;
quit;
/* plot overlay */
title "Overlay of Splines";
proc sgplot data=spline noautolegend;
series x=x y=y / group=group lineattrs=GraphData1 transparency=0.9; /* turn on transparency */
run;