+ Reply to Thread
Results 1 to 6 of 6

Thread: OPNQRYF works, but RPG pgm finds no records

  1. #1
    K.Forsythe Guest

    Default OPNQRYF works, but RPG pgm finds no records

    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!

  2. #2
    Guest.Visitor Guest

    Default OPNQRYF works, but RPG pgm finds no records

    You are right. I commented out my debugging tool and it works fine! Thanks

  3. #3
    K.Forsythe Guest

    Default OPNQRYF works, but RPG pgm finds no records


  4. #4

    Default OPNQRYF works, but RPG pgm finds no records

    You can still read the file in RPG program after the CPYFRMQRYF file. You just have to reposition the file pointer to start by using POSDBF POSITION(*START). Call the program after this and close the OPNQRYF and delete overrides.

  5. #5
    Guest.Visitor Guest

    Default 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?

  6. #6
    Guest.Visitor Guest

    Default OPNQRYF works, but RPG pgm finds no records

    Hello You can use a share on the OPNQRYF instead of the CPYFRMQRYF. See the code in exemple. Regards
    Code

+ Reply to Thread

Similar Threads

  1. ovrprtf works in CLP *pgm but not CLP *mod
    By David Abramowitz in forum CL
    Replies: 3
    Last Post: 03-30-2004, 11:22 AM
  2. Selecting records using OPNQRYF
    By Guest.Visitor in forum CL
    Replies: 3
    Last Post: 03-04-2003, 11:28 AM
  3. What works and doesn't work in Webfacing?
    By Guest.Visitor in forum Dev Tools
    Replies: 3
    Last Post: 02-01-2002, 08:32 AM
  4. It works...but why?
    By Guest.Visitor in forum Programming
    Replies: 8
    Last Post: 09-04-1998, 03:20 PM
  5. OfficeVision/400 Works on V5R1
    By Guest.Visitor in forum IBM i (OS/400, i5/OS)
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

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