I have converted an RPG/400 finder program to an RPG4 profiled procedure. I have resolved all compile time errors, however a runtime error CPF5021 occurs (incorrect relative record number) when the subfile is loaded the first time, despite the fact that the relative record number is 1 and the subfile has been cleared before the write operation. Do you know what might be causing this and how I can resolve it?
Generally, this is probably an If the indicator for SFLCLR or SFLINZ is still set, you cannot write a record to the subfile. If the indicator for SFLDSP and/or SFLDSPCTL are set and the display file is set to DFRWRT(*NO) or FRCDTA is set, it could also cause this although it will usually just display the subfile to the workstation as it gets loaded.
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.