If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
The Open Data Path (ODP) is the set of structures built in memory by the operating system when you open a file. It contains pointers to all of the operating system routines that are valid for the file. It also contains the buffers used to transfer records (or blocks of records) between your program and the file. Other related elements are included.
For example, there will be a pointer to the system routine that writes records to database files. If the file was opened to a printer file, the pointer in that part of the ODP would point to the routine that outputs to a printer. Everything related to the type of device is linked to through the ODP.
When you apply an override, the job applies it to the ODP that is created when the file is opened. The library name might be changed. The file name might be changed. Device attributes might be changed. Even the device type might be changed.
Every program within the scope of the ODP will see the same changes.
When an ODP is shared, the scope of the ODP grows. Multiple programs will be connected to the same set of data structures. That includes record buffers, device attributes, whatever was used to build the ODP.
Since the record buffers are shared, if program A reads a record from the file and calls program B, then if program B opens the same file and reads a record, it will get the second record in the file. Program B can end and return to program A. If program A then reads another record, it will get the third record in the file even though program A has only issued two reads.
In short, the ODP is what gets built in memory to connect a program to a file.
…connect a job to a file I think the last line should read job instead of program.
In light of the question about “SHARE(*YES)”, that might be a worthwhile way to think of it. Programs connect to files through ODPs, but the ODPs can be accessed by multiple programs in the same job. When shared, they are reasonably thought of at the job or activation group level.
The Open Data Path (ODP) is the set of structures built in memory by the operating system when you open a file. It contains pointers to all of the operating system routines that are valid for the file. It also contains the buffers used to transfer records (or blocks of records) between your program and the file. Other related elements are included.
For example, there will be a pointer to the system routine that writes records to database files. If the file was opened to a printer file, the pointer in that part of the ODP would point to the routine that outputs to a printer. Everything related to the type of device is linked to through the ODP.
When you apply an override, the job applies it to the ODP that is created when the file is opened. The library name might be changed. The file name might be changed. Device attributes might be changed. Even the device type might be changed.
Every program within the scope of the ODP will see the same changes.
When an ODP is shared, the scope of the ODP grows. Multiple programs will be connected to the same set of data structures. That includes record buffers, device attributes, whatever was used to build the ODP.
Since the record buffers are shared, if program A reads a record from the file and calls program B, then if program B opens the same file and reads a record, it will get the second record in the file. Program B can end and return to program A. If program A then reads another record, it will get the third record in the file even though program A has only issued two reads.
In short, the ODP is what gets built in memory to connect a program to a file.
Tom
Absolutely wonderful explaination Tom, as usual.
…connect a job to a file I think the last line should read job instead of program.
Phil
…connect a job to a file I think the last line should read job instead of program.
In light of the question about “SHARE(*YES)”, that might be a worthwhile way to think of it. Programs connect to files through ODPs, but the ODPs can be accessed by multiple programs in the same job. When shared, they are reasonably thought of at the job or activation group level.
Tom
It means that if the member is opened more than once then the same open data path is shared with each program in the job.