You have tried to write a record to a variable length record file, the length of which is not within the defined range for that file.
Recode your program.