By default, the database management system lets one file be read and changed by many users at the same time. However, you can share the database files in the same job or activation group through the SHARE parameter.
The SHARE parameter on the create file, change file, and override database file commands allow sharing in a job or activation group, including sharing the file, its status, its positions, and its storage area. Sharing files in the job or activation group can improve performance by reducing the amount of main storage needed and by reducing the time needed to open and close the file.
Using the SHARE(*YES) parameter lets two or more programs running in the same job or activation group share an open data path (ODP). An open data path is the path through which all input/output operations for the file are performed. In a sense, it connects the program to a file. If you do not specify the SHARE(*YES) parameter, a new open data path is created every time a file is opened. If an active file is opened more than once in the same job or activation group, you can use the active ODP for the file with the current open of the file. You do not have to create a new open data path.
This reduces the amount of time required to open the file after the first open, and the amount of main storage required by the job or activation group. SHARE(*YES) must be specified for the first open and other opens of the same file for the ODP to be shared. A well-designed (for performance) application normally shares an ODP with files that are opened in multiple programs in the same job or activation group.