Writing to the end of a record

Hi, I am trying to write to the end of a record once I find the data needed, but everything I have tried and the Internet is no real help. I open my data file by using 'open (LOCATE +<$filename') and the data is processed correctly when a match is found. It is when I try to write to the end is when I have trouble.