That since the access path of the OPNQRY FILE is being shared, the CPYFRMQRYF commnad isreading it to end of file, and that is where the RPG program starts. Is there a need to perform the CPYFRMQRYF? Could the RPG program be modified to read that file instead? You can verify this by simply commenting out the CPYFRMQRYF and see if the RPG program gets data this time. Then figure out how to redesign the app. Good luck!
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
OPNQRYF works, but RPG pgm finds no records
Collapse
X
-
OPNQRYF works, but RPG pgm finds no records
I use the following to create a view over my file to be read by the program: OVRDBF FILE(TRPHIST) SHARE(*YES) /* */ OPNQRYF FILE((TRPHIST)) FORMAT(*FILE) + QRYSLT(&QRYSLT) KEYFLD((&KEY1) (&KEY2) + (&KEY3) (&KEY4)) CPYFRMQRYF FROMOPNID(TRPHIST) TOFILE(DACLIB/QRYOUTP) + MBROPT(*REPLACE) CRTFILE(*NO) CALL PGM(TRRTRPRT) PARM(&TRTYP) The program (TRRTRPRT) reads TRPHIST... and ends immediately with %Eof condition. This WORKED at first, but then didn't after I started messing with the Key fields... but the copied query file looks fine! Any ideas?
Comment
Comment