Previous Topic: DB-Keys and Page InformationNext Topic: Use and Updating of Currency by DML Verbs


Run Unit Currencies

During the execution of your application program, the DBMS uses currency to keep track of the database location (db-key) of the most recently accessed record occurrences for the run unit, record type, set, and area. By keeping track of the most recently accessed records, currency enables you to navigate the database with a minimum of effort. Currency values determine which record occurrences are affected by DML functions requested by an application program. Upon successful execution of a DML statement, the DBMS automatically updates currency values, as appropriate.

A record occurrence can be:

Current of Run Unit

The record occurrence that was the object of the most recent successful FIND, OBTAIN, CONNECT, STORE, MODIFY, DISCONNECT, or ERASE function is current of run unit. Only one current record of run unit exists at any given time during program execution. That record's db-key, record type and qualifying page information are placed in the DBKEY, RECORD-NAME and PAGE-INFO fields of the IDMS communications block.

For more information on the IDMS communications block, see IDMS Communications Block.

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 defined in the program's subschema. For example, when your program successfully retrieves JOB 2215, that record becomes current of the JOB record type. If you then successfully obtain EMPLOYEE 466, 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 set for that set. At any given time during program execution, one current record can exist for each set defined in the program's subschema.

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 current record can exist for each area defined to the program's subschema.

When Currency is Established

At the beginning of a program, all currencies are null. Currency is established by the DML FIND, OBTAIN, RETURN, or STORE function. Currency is updated following each successful execution of a FIND, OBTAIN, CONNECT, DISCONNECT, ERASE, RETURN, MODIFY, or STORE statement.

How the DBMS Uses Currency

The DBMS uses currency to: