Previous Topic: User Kept StorageNext Topic: Shared Kept Storage


Shared Storage

Shared storage is available to all tasks running concurrently under the CA IDMS system.

Shared storage is usually accessed by a concurrent nonterminal task. For example, such a nonterminal task might support the main task by performing print functions.

For more information on nonterminal tasks, see Initiating Nonterminal Tasks.

When Shared Storage Is Released

CA IDMS maintains an in-use counter for each area of shared storage. Each time a task establishes addressability to an area of shared storage, CA IDMS adds 1 to the in-use counter. When a task terminates or releases the storage, CA IDMS subtracts 1 from the in-use counter. CA IDMS releases shared storage when the in-use counter is set to zero.

Steps to Acquire Shared Storage

To dynamically acquire and use variable storage from the storage pool and make the storage available to other tasks running under the same CA IDMS system, perform the following steps:

  1. Acquire variable storage from the storage pool by issuing a GET STORAGE statement that specifies the SHARED parameter.
  2. Check for an ERROR-STATUS of 3210 (DC-NEW-STORAGE).
  3. Perform the IDMS-STATUS routine if 3210 is not returned.
  4. Perform processing, using the acquired storage as needed.
  5. Optionally, release the shared storage by issuing a FREE STORAGE statement that specifies the appropriate storage ID.

Steps to Access Shared Storage

To access the data from another task executing concurrently under the same CA IDMS system, perform the following steps:

  1. Establish addressability to the previously acquired storage by issuing a GET STORAGE request that names the storage ID specified for the storage area when it was first allocated.
  2. Perform processing using the acquired data.
  3. Optionally, release the shared storage by issuing a FREE STORAGE statement that specifies the appropriate storage ID.