OPNQRYF
5 pts.
0
Q:
OPNQRYF
Is it possible to access a file created by opnqryf in an RPG/400 program using keys? I have defined the KEYFLD parameter but the RPG doesn't find the records when using READE or CHAIN
ASKED: May 14 2009  3:37 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24570 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Hi,

Have you used OVRDBF SAHRE(*YES) on your file? OPNQRYF won't work without it.
If you are using OvrDbf, are you using KEYFLD keyword on OPNQRYF?

Regards,

Wilson

I forgot the SEQONLY(*NO) parameter. It must be present too.

Wilson

//////////////////////////
And the RPG program must be compiled with the file with a similar key and using Keyed Access.

Phil
Last Answered: May 15 2009  1:18 PM GMT by Philpl1jb   24570 pts.
Latest Contributors: WilsonAlano   2005 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

WoodEngineer   2280 pts.  |   May 18 2009  3:52PM GMT

CPYFRMQRYF might do what you want. Its a bit like CPYF but uses everything you have coded into your OPNQRYF command. This is an efficient way to handle data if multiple programs need to work with the same OPNQRYF data. It prevents the overhead of multiple OPNQRYF’s which select, sequence, group, key the same data.

All the same rules apply, just as if you were reading the results into an RPG or COBOL program.

 
0