Obtaining storage for the source and target

Before you can issue IARVSERV to define storage as shared, you must obtain or create both the source and target areas. For address space storage, use the GETMAIN or STORAGE macro; for data space storage, use the DSPSERV macro. The source and target areas must be as follows:
  • Start on a page boundary,
  • Have the same storage protect key and fetch-protection status (except for TARGET_VIEW=UNIQUEWRITE or TARGET_VIEW=LIKESOURCE and the source has UNIQUEWRITE view),
  • Meet one of the following requirements:
    • Reside within pageable private storage of an address space.
    • Reside within the valid size of an existing data space and be pageable storage.

The source and the target must be two different storage areas. They must be different virtual storage addresses or reside in different address or data spaces.

Then initialize the source with data. Make sure any storage you obtain or data space you create can be accessed by the intended sharing programs. For example, if you want to allow sharing programs to both read and modify a target, the programs' PSW key value must match or override the target's storage protection key. For information on data spaces, see Data spaces and hiperspaces.
Note: Do not allocate key 8 or key 9 storage in the common area because it can be read or written by any program in any address space.