Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

OpnQryF and Multiple Calls

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

  • OpnQryF and Multiple Calls

    You can do this. I do it all the time. After the first CALL, issue a POSDBF to move the record pointer back to the start, then call the next program, etc. POSDBF OPNID(MYFILE) POSITION(*START) ==Scott==

  • #2
    OpnQryF and Multiple Calls

    POSDBF is the best technique, but you shouldn't need it in this case, since you're reading the file randomly. If all the programs that use the file are only using CHAIN to access it, you don't have to reset the file pointer. Be sure to specify SEQONLY(*NO) in the OPNQRYF.

    Comment


    • #3
      OpnQryF and Multiple Calls

      Good point, Ted. Also, I think I recall some problem of when you read the OPNQRYF file all the way to the end until you get an EOF condition, you can't POSDBF to *Start after that? (This doesn't apply to chains, just doing a READ to EOF). ==Scott==

      Comment


      • #4
        OpnQryF and Multiple Calls

        I'm not sure what you're asking, Scott. If you access the file sequentially, and hit EOF, you can reposition the file pointer. Maybe you're thinking of CL. When a CL program hits EOF, there's no way to reposition.

        Comment


        • #5
          OpnQryF and Multiple Calls

          Ted, Thanks for this, I was just getting ready to ask why this would be necessary on a chained file. Scott, Thanks for your note. It's all working. Bill > POSDBF is the best technique, but you shouldn't need it in this case, since you're reading the file randomly. If all the programs that use the file are only using CHAIN to access it, you don't have to reset the file pointer. Be sure to specify SEQONLY(*NO) in the OPNQRYF.

          Comment


          • #6
            OpnQryF and Multiple Calls

            Yes. Thanks for turning my memory back on. It's reading a file in a CL that won't reposition after EOF. I must have had a brain cramp. Either that or too many irons in the fire lately... Thanks Ted. ==Scott==

            Comment


            • #7
              OpnQryF and Multiple Calls

              I have a situation where I'd like an OpnQryF filter to exist across programs that are called sequentially. I'm not sure if I can do what I need to do. If it makes any difference the filtered file will be chained to. Here's what I'd like to do: OvrDbf OpnQryF Call Call Call CloF DltOvr Can I do that, or do I need to do this: OvrDbf OpnQryF Call Clof OpnQryF etc.... Bill

              Comment


              • #8
                OpnQryF and Multiple Calls

                You're like everybody else, Scott -- trying to juggle too many "opportunities" at once. Don't be too hard on yourself.

                Comment

                Working...
                X