I assume that it is a data issue. The code worked fine for my test case with 2 columns, but it is written to handle as many columns as it finds in the variable "predt"
For( i = 1, i <= N Cols( predt ), i++,
So, what you need to do, is to step through the code and check the variable values and see what is happening. Without your data being posted to this discussion, I don't know what is going on.
Are there any messages being displayed to the Log?
Jim