The @FIND/@OBTAIN CURRENT statement accesses the record that is current of its record type, set, or area. This form of the @FIND/@OBTAIN verb is an efficient means of establishing the proper record as current of run unit before executing a DML verb that utilizes run-unit currency (for example, @ACCEPT, @IF, @GET, @MODIFY, or @ERASE).
Currency - Following successful execution of an @FIND/@OBTAIN CURRENT statement, the accessed record is current of run unit, its area, its record type, and all sets in which it currently participates as member or owner.
Syntax
►►─┬─ @FIND ───┬────── CURRENT ───────────────────────────────────────────────► └─ @OBTAIN ─┘ ►─┬────────────────────┬─────────────────────────────────────────────────────► ├─ ,REC=record-name ─┤ ├─ ,SET=set-name ────┤ └─ ,AREA=area─name ──┘ ►─┬───────────────────────────┬──────────────────────────────────────────────►◄ └─ ,KEEP= ─┬─ SHARED ──────┬┘ └─ EXCLUSIVE ───┘
Parameters
Accesses the record occurrence that is current of run unit.
Specifies that the current record of the named record type, set, or area is to be accessed.
Accesses the record that is current of run unit.
A register containing the record name, a user-defined variable field, or a user-supplied value enclosed in quotation marks.
Accesses the set that is current of run unit.
A register containing the set name, a user-defined variable field, or a user-supplied value enclosed in quotation marks.
Accesses the area that is current of run unit.
A register containing the area name, a user-defined variable field, or a user-supplied value enclosed in quotation marks.
Places a shared or exclusive lock on the accessed record.
Places a shared lock on the specified record.
Places an exclusive lock on the specified record.
Example
The following figure illustrates the use of the @FIND/@OBTAIN CURRENT statement to establish a record as current of run unit before that record is modified. (See @MODIFY later in this chapter for a complete description of the @MODIFY verb and its use.) Enter the database on DEPARTMENT 5100 by using CALC retrieval. Then examine EMPLOYEE 466 and obtain further information from its owner OFFICE record. 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.


Status Codes
After completion of the @FIND/@OBTAIN CURRENT function, the ERRSTAT field in the IDMS communications block indicates the outcome of the operation. The following is a list of the acceptable status codes for this function and their corresponding meaning:
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 specified record 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 has not been established or has been nullified by a previous @ERASE statement.
The area name specified has not been included in the subschema invoked.
When the KEEP parameter is specified, a major code of 06 will be returned if an error occurs during the KEEP processing. The major code of 03 states that an error has occurred in the @FIND/@OBTAIN processing.
|
Copyright © 2014 CA.
All rights reserved.
|
|