View Full Version : OPNQRYF - Find number of rcds selected
David Abramowitz
01-01-1995, 02:00 AM
On Tuesday, September 16, 1997, 12:05 PM, Ken Gaede wrote: Is there a way to find out how many records will be read after doing an opnqryf (with keyfld & qryslt both entered). We have an inquiry where users type in sort fields and any filters they want to put on the data. From this we build an opnqryf statement, read the records and put them to a subfile (building a page at a time). What they want to see is how many records passed the filters and will be displayed. This is a good topic for an OS/400 improvement. I have wanted this feature for years. The only way I know of accomplishing this. is to execute a CPYFRMQRYF immediately after the OPNQRYF, and then a RTVMBRD to get the number of records in the newly created file. David Abramowitz
Guest.Visitor
09-18-1997, 12:12 PM
On Tuesday, September 16, 1997, 12:05 PM, Ken Gaede wrote: Is there a way to find out how many records will be read after doing an opnqryf (with keyfld & qryslt both entered). We have an inquiry where users type in sort fields and any filters they want to put on the data. From this we build an opnqryf statement, read the records and put them to a subfile (building a page at a time). What they want to see is how many records passed the filters and will be displayed. Any help is appreciated! Ken Here is another alternative. Create a dummy physical file, specify MBR(*NONE). Describe a summary field such as COUNT 5 0. Build your OPNQRYF statement with the summary function %COUNT. Override your summary work file to your data file. Do a RCVF and now you have your record count. You can display the count to your users and if acceptable you can then extract the detail data through another OPNQRYF.
Guest.Visitor
09-22-1997, 03:29 PM
Ken: There was a tip of "<font color="aa00ff">Determining if OPNQRYF selected any records</font>" in Midrange Computing 04/95. See Tech Talk section on p.104. It uses CPYFRMQRYF command. Just check how it's done. Regards, <A > href="http://www2.cybernex.net/~irash">Ira</A>
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.