# Interpolation of a "bit by bit" Function

I am facing a problem with integrating a function. I have to integrate the function "bit by bit". This is the smallest working example that shows the problem:

n = 25;
dz = 1300/n;
pBF = FunctionInterpolation[
Piecewise[{{9890/3, 500 <= z <= 800}}],
{z, 0, 1300}, InterpolationOrder -> 1
];
data = Prepend[0]@Table[Integrate[pBF[z] z, {z, (j - 1) dz, j dz}], {j, n}];
Data = Accumulate[data];
DataInt = Interpolation[Table[{k dz, Data[[k + 1]]}, {k, 0, n}], InterpolationOrder -> 1]


Insted of creating an InterpolatingFunction Mathematica prints the two error messages:

Integrate::ilim: Invalid integration variable or limit(s) in {0.026557142857,0,52}. NIntegrate::itraw: Raw object 0.026557142857142856 cannot be used as an iterator.

The strange thing with this is the fact that when I look at the data-points in a ListPlot the function should not be hard to interpolate. The picture shows the ListPlot.

I solved the problem by using NIntegrate and defining the AccuracyGoal and the MinRecursion option for this function.
data2 = Prepend[0]@
`