DEFINE AXIS/X occurences = hval[x=1:33]
I don't know what hval is. Also, has it been already sorted? See
LET pdf = I[gx=occurences]
Please you the lower-case "i": I thought it was an ell (L)!
DEFINE AXIS/X=1900:2100:1 my_intervals
let frequency=pdf[gx=my_intervals@sum]
I guess this gives you a PDF (histogram) of hval, but the value at x=2019, for example, is the number of occurrences between 2018.5 and 2019.5. If it's okay, then I think this is what you want.
I don't find other problems. I hope people more familiar with this kind of operations will be able to help.
Cheers,
Ryo