@ACCEPT DBKEY FROM CURRENCY -- moves the db-key of the current record
The @ACCEPT DBKEY FROM CURRENCY statement moves the db-key of the current record of run unit, record type, set, or area to a specified location in program variable storage. Use the PGINFO option to specify a location in program variable storage where the page information associated with the returned dbkey is moved. Records whose db-key are saved in this manner are available for subsequent direct access by using an @FIND/@OBTAIN DBKEY statement.
idmscu
The @ACCEPT DBKEY FROM CURRENCY statement moves the db-key of the current record of run unit, record type, set, or area to a specified location in program variable storage. Use the PGINFO option to specify a location in program variable storage where the page information associated with the returned dbkey is moved. Records whose db-key are saved in this manner are available for subsequent direct access by using an @FIND/@OBTAIN DBKEY statement.
This article describes the following information:
2
2
Currency
The record must be current of run unit, record type, set, or area before execution of the @ACCEPT DBKEY FROM CURRENCY statement. Currency is maintained but not updated after the statement is executed.
You must establish set currency before using this statement. If no set currency has been established, the DBMS returns 0000 to the ERRSTAT field and -1 to the DB-KEY field.
For more information on page information fields, see @ACCEPT PGINFO.
Syntax
►►─── @ACCEPT DBKEY=db-key─────┬─────────────────────┬───────────────────────► └─ ,PGINFO=pg-info-v─┘ ►─┬────────────────────┬─────────────────────────────────────────────────────►◄ ├─ ,REC=record-name─┤ ├─ ,SET=set-name─┤ └─ ,AREA=area-name─┘
Parameters
DBKEY=
db-key
Identifies the location in variable storage that will contain the db-key of the named record. Must identify a full-word binary field.
PGINFO=
pg-info-v
Specifies the name of a four-byte field that is made up of two halfword fields. Identifies the location in variable storage that contains page information for the specified record. Upon successful completion of this statement, the first two bytes of the field contain the page group number and the last two bytes contain a value that may be used for interpreting dbkeys.
REC=
record-name/
SET=set-name/
AREA=area-name
Specifies the record whose db-key will be placed in the location identified by
db-key
. If the record, set, or area qualifiers are omitted, the db-key of the current record of run unit is saved. Otherwise, db-keys are saved as follows:- REC=record-namesaves the db-key of the record that is current of the specified record type.
- SET=set-namesaves the db-key of the record that is current of the specified set.
- AREA=area-namesaves the db-key of the record that is current of the specified area.
Status Codes
After completion of the @ACCEPT DBKEY FROM CURRENCY 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:
- 0000The request has been serviced successfully.
- 1508The specified record is not in the subschema. The program has probably invoked the wrong subschema.
Example
The following statements illustrate the use of the @ACCEPT DBKEY FROM CURRENCY statement. The program performs the following steps:
- Establishes an EMPLOYEE record as current of run unit
- Saves its db-key in location SAVEDKEY
- Accesses the EMPLOYEE record occurrence by using the saved db-key, after further processing has changed currencyMVC EMPID,=CL4'7690' @FIND CALC,REC='EMPLOYEE' @ACCEPT DBKEY=SAVEDKEY . . @OBTAIN DBKEY=SAVEDKEY