Defining storage for sharing data and access

With the IARVSERV macro, you can define multiple types of data sharing and access. As you read this information, use Figure 1 to see how each IARVSERV parameter acts on the current state of the data. Each type of data sharing access is called a specific view of the source data. A view is the way your program accesses, or sees, the data. You define the view in the TARGET_VIEW parameter on IARVSERV, by specifying one of the following:
  • Read-only view (READONLY value) — where the target data may not be modified.
  • Shared-write view (SHAREDWRITE value) — where the target data can be read and modified through the view.
  • Copy-on-write view (UNIQUEWRITE value) — where the source data modifications are not seen by other source - sharing programs. Any attempt to modify the shared source data in this view causes MVS™ to create a unique target copy of the affected page for that address or data space.
    An example of two different cases:
    • If the shared data is modified through a SHAREDWRITE view, the UNIQUEWRITE view gets an unmodified copy of the data. Any remaining views sharing that data see the modified data.
    • If the shared data is modified through a UNIQUEWRITE view, the UNIQUEWRITE view gets the modified copy of the data. Any remaining views sharing that data see the unmodified data.
  • Copy-on-write target view (TARGETWRITE value) — where the target data may be read and modified through the source view. Any modification of a shared target page causes MVS to create a unique target copy of the affected page for that address or data space.
    An example for two different cases:
    • If the shared data is modified through a SHAREDWRITE view, the TARGETWRITE view sees the modified data.
    • If the shared data is modified through a TARGETWRITE view, the TARGETWRITE view sees the modified copy of the data. Any remaining views sharing that data see the unmodified data.
  • Like source view (LIKESOURCE value) — where the target data is given the current view type of the source data. If the source data is currently not shared, then its current storage attribute is given to the target.
  • Hidden view (HIDDEN value) — where the target will share the source data, but any attempt to access the target data (HIDDEN value) will cause a program check. To access the target, the view type must be changed to READONLY, SHAREDWRITE, UNIQUEWRITE, or TARGETWRITE.
When you specify a value for TARGET_VIEW, keep the following in mind:
  • The execution key (PSW key) of the caller must be sufficient for altering the target area. If TARGET_VIEW=SHAREDWRITE is specified, the execution key must be sufficient for altering the source area also.
  • The SHAREDWRITE value cannot be specified if the source contains sharing pages that have the READONLY view mode attribute, are page protected, or are protected by attribute (such as PLPA).
  • For TARGET_VIEW=UNIQUEWRITE, if the input source area is address space storage, and the storage has not been obtained by GETMAIN or STORAGE OBTAIN, or the storage and fetch protect keys do not match, then the SHARE is not performed for that area. The target will be all zeros (first reference), or it will remain as pages that were not obtained by GETMAIN.
  • For target views created with LIKESOURCE on IARVSERV SHARE, the system propagates explicit page protection from the source to the target view.
  • Page-fixed pages and DREF pages cannot be made TARGETWRITE, UNIQUEWRITE, or HIDDEN.