ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OPNQRYF not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OPNQRYF not working

    I have the following statement:

    Code:
    OPNQRYF    FILE((FileA)) OPTION(*ALL) +     
                  QRYSLT('SYMBOL *EQ "AAA"') KEYFLD(*FILE)
    This doesn't work. I the program, the file is still finding and processing records with SYMBOLs that are not AAA. What am I missing? SYMBOL is one of the keys for the file. Is that causing a problem.

    Jane22

  • #2
    Re: OPNQRYF not working

    You need to execute an OVRDBF before the OPNQRYF and a DLTOVER afterward.
    Code:
    OVRDBF     FILE(FILEA)
    OPNQRYF    FILE((FileA)) OPTION(*ALL) +     
                  QRYSLT('SYMBOL *EQ "AAA"') KEYFLD(*FILE) 
    DLTOVR     FILE(FILEA)
    Predictions are usually difficult, especially about the future. ~Yogi Berra

    Vertical Software Systems
    VSS.biz

    Comment


    • #3
      Re: OPNQRYF not working

      Also for a quick test to see if its working try the command CPYFRMQRYF ....
      after you put in the OVRDBF



      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: OPNQRYF not working

        Normal sequence of OPNQRYF is:

        OVRDBF
        OPNQRYF
        CALL pgm
        CLOF
        DLTOVR

        Comment


        • #5
          Re: OPNQRYF not working

          Also check the activation group on your override.
          Never trust a dog to watch your food.

          Comment


          • #6
            Re: OPNQRYF not working

            Thanks for your help. I got it to work. I was missing SHARE(*YES) on my override.

            Jane22

            Comment

            Working...
            X