+ Reply to Thread
Results 1 to 3 of 3

Thread: OPNQRYF - Find number of rcds selected

  1. #1

    Default OPNQRYF - Find number of rcds selected

    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

  2. #2
    Guest.Visitor Guest

    Default OPNQRYF - Find number of rcds selected

    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.

  3. #3
    Guest.Visitor Guest

    Default OPNQRYF - Find number of rcds selected

    Ken: There was a tip of "Determining if OPNQRYF selected any records" in Midrange Computing 04/95. See Tech Talk section on p.104. It uses CPYFRMQRYF command. Just check how it's done. Regards, href="http://www2.cybernex.net/~irash">Ira

+ Reply to Thread

Similar Threads

  1. Here's why you can't find work:
    By nycsusan@hotmail.com in forum Shooting the Breeze
    Replies: 12
    Last Post: 12-13-2002, 12:45 PM
  2. Cannot print selected code - HELP!
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 09-07-2001, 09:49 AM
  3. Processing Selected Documents of a View
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 05-16-2001, 04:30 PM
  4. spool file name & number, job name, number and user
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 07-24-2000, 01:26 PM
  5. Replies: 2
    Last Post: 07-11-2000, 08:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts