ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OPNQRYF and OVRDBF SHARE = YES?

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

  • OPNQRYF and OVRDBF SHARE = YES?

    We have several legacy CL and RPG/400 programs that use OPNQRYF. It is my understanding that in order to use OPNQRYF, you must use OVRDBF with SHARE = *YES (share open data path). If we do not have OVRDBF SHARE = *YES, the programs will not select any data. Let me know if I am wrong about this.

    OVRDBF SHARE = *YES works fine if we run jobs in the same subsystem sequentially. However, we would like to run several jobs concurrently in the same subsystem that uses the same file(s) and OPNQRYF command. However, this has caused report programs running concurrently to have data from the other jobs corrupting the report(s). Again, it is my understanding that if you share the data path, then there is only one record pointer to the file.

    Ultimately, we want to modernize our legacy programs and convert them to RPG IV with embedded SQL. If we do this, then it is my understanding that each program with have its own SQL cursor so that data does not get corrupted. Is this true?

    Please let me know your thoughts on the topics I have discussed. Any help would be greatly appreciated.

    Thanks, Pat

  • #2
    Re: OPNQRYF and OVRDBF SHARE = YES?

    Separate jobs will not share the open data path. Excerpt from help on the SHARE parameter:

    Specifies whether the open data path (ODP) is shared with
    other programs in the same routing step. When an ODP is
    shared, the programs accessing the file share facilities
    such as the file status and the buffer.

    Comment


    • #3
      Re: OPNQRYF and OVRDBF SHARE = YES?

      Scott,

      OK, that is good to know. How can I get multiple jobs to run concurrently in the same subsystem with OPNQRYF and not share the ODP?

      Thanks, Pat

      Comment


      • #4
        Re: OPNQRYF and OVRDBF SHARE = YES?

        Scott M just told you that separate jobs NEVER share the ODP. You said "that is good to know." So.... Why are you asking him how to prevent them from sharing it? They won't share it. They couldn't share it. It's not possible for separate jobs to share the ODP with one another.

        Comment


        • #5
          Re: OPNQRYF and OVRDBF SHARE = YES?

          When I submit the same job stream multiple times with different selection criteria, data gets intermingled among the reports when the jobs are running concurrently in the same subsystem. I'm not sure why this is happening. Thanks, Pat

          Comment

          Working...
          X