Viz,
besides the obvious typo's (i hope), are you sure about those 952 records ? If not, and you read more than that, you overshoot your table end, indexing elements outside the range of it's index. I'm not completely sure, but i strongly suspect that's the cause of your S(0C4).
Build in a test on the maximum number of records to be processed to prevent this. If you signal (i.e. display) this, you'll know that you want to process more than 952 records and can consider enlarging your table.
Good luck,
Ronald.