The FIND/OBTAIN CURRENT statement locates the record that is current of its record type, set, or area. This form of the FIND/OBTAIN statement is an efficient means of establishing the appropriate record as current of run unit before executing a DML statement that utilizes run-unit currency (for example, ACCEPT, IF, GET, MODIFY, ERASE).
Currency
Following successful execution of a FIND/OBTAIN CURRENT statement, the accessed record is current of run unit, its record type, its area, and all sets in which it currently participates as member or owner.
►►─┬─ FIND ───┬─┬────────────────────────┬─ CURRENT ──────────────────────────► └─ OBTAIN ─┘ └─ KEEP ─┬─────────────┬─┘ └─ EXCLUSIVE ─┘ ►─┬────────────────────────┬─ ; ─────────────────────────────────────────────►◄ ├─ RECORD (record-name) ─┤ ├─ SET (set-name) ───────┤ └─ AREA (area-name) ─────┘
Locates the current record occurrence of a specified record type, set, or area.
Places a shared (KEEP) or exclusive (KEEP EXCLUSIVE) lock on the accessed record.
Specifies that the current record of the named record type, set, or area is to be accessed.
The following figure illustrates use of the FIND/OBTAIN CURRENT statement to establish the proper record as current of run unit before the record is modified.
Assume that you enter the database on DEPARTMENT 5100 by using CALC retrieval. You examine EMPLOYEE 466 by using within set retrieval and obtain further information from its owner OFFICE record (OFFICE 8). OFFICE 8 becomes current of run unit. Before modifying EMPLOYEE 466, you must issue the FIND CURRENT statement to reestablish EMPLOYEE 466 as current of run unit.


Note: For more information about MODIFY statement and its use, see MODIFY RECORD.
Upon completion of the FIND/OBTAIN CURRENT function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
The area in which the named record participates has not been readied.
Currency has not been established for the named record, set, or area.
The named record or set is not in the subschema. The program has probably invoked the wrong subschema.
The subschema specifies an access restriction that prohibits retrieval of the named record.
A current record of run unit either has not been established or has been nullified by a previous ERASE statement.
The specified area name has not been included in the subschema invoked.
If the KEEP parameter is specified in a FIND/OBTAIN statement, and an error occurs during KEEP processing, the major code 06 is returned.
Note: For more information, see KEEP CURRENT, later in this chapter. The major code 03 is returned if an error occurs during FIND/OBTAIN processing.
|
Copyright © 2014 CA.
All rights reserved.
|
|