If your file is opened in input mode then there should not be any problem. If it is in update mode then the UPDATE opcode should be executed before going to the next program. And if your are not updating a record then use CHAIN(N) while reading a file.
Please let me know if this answers your question!!!
No, it does not answer my question. I still hit the CPF5032 error when I use CHAIN(N). I also try UNLOCK file. Still hit CPF5032.