Previous Topic: Retrieving DataNext Topic: Retrieval Functions


Currency

To enable a program to retrieve data efficiently, CA IDMS saves the database keys of the most recently accessed records, known as currencies. There are four types of currencies maintained by the DBMS:

Current of Run Unit

The record occurrence that was the target of the most recent retrieval or update function is current of run unit. Only one record occurrence is current of run unit at any given time during program execution.

Current of Record Type

The most recently accessed occurrence of each record type is current of that record type. At any given time during program execution, one current record can exist for each record type. For example, when your program successfully retrieves JOB Programmer, that record becomes current of the JOB record type. If you then successfully obtain EMPLOYEE John Done, that record becomes current of the EMPLOYEE record type; currency for the JOB record type remains unchanged.

Current of Set

The most recently accessed record occurrence in each set is current of that set. At any given time during program execution, one current record can exist for each set type.

Because a successfully accessed record becomes the current record of all sets in which it participates as either owner or member, a given record occurrence can be the current record of any number of sets.

Current of Area

The most recently accessed record occurrence in each area is current of area for that area. At any given time during program execution, one record can be current for each area.

The following figure illustrates how currencies change as different records are accessed in the sample database. All currencies begin as null.

C++, C++ B, C++ A, and John Done are accessed sequentially. As we access a record, it becomes current of run unit, its record type, its area, and all sets in which it participates. C++ A becomes current of both SKILL-EXPERTISE and EMP-EXPERTISE sets. When we access John Done, it becomes current of the EMP-EXPERTISE set while C++ A remains current of the SKILL-EXPERTISE set.