The ACCEPT DBKEY FROM CURRENCY statement moves the db-key and optionally the page information of the current record of run unit, record type, set, or area to a specified location in program variable storage. By using a FIND/OBTAIN DBKEY statement, you can directly access records whose db-keys you save using the ACCEPT DBKEY FROM CURRENCY statement.
ACCEPT DBKEY FROM CURRENCY does not update currencies.
►►─── ACCEPT CURRENCY ─┬────────────────────────┬───────────────────► ├─ RECORD (record-name) ─┤ ├─ SET (set name) ───────┤ └─ AREA (area-name) ─────┘ ►─ INTO (db-key-field)─┬─────────────────────────────────────┬─ ; ─►◄ └ PAGE INFO INTO (page-info-location ─┘
Saves the db-key of the record current of the specified record type into the location specified by db-key-field.
Saves the db-key of the record current of the specified set into the location specified by db-key-field.
Saves the db-key of the record current of the specified area into the location specified by db-key-field.
Identifies the location in variable storage that will contain the db-key of the specified record. Db-key-field must be a FIXED BINARY(31) field.
Note: If you omit the RECORD, SET, or AREA qualifiers, the DBMS saves the db-key of the record current of run unit.
Specifies the name of the four-byte field that can be defined either as a group field or as a fullword field (PIC S9(8) COMP). Identifies the location in variable storage that contains page information for the specified record type. 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 db-key radix that can be used for interpreting dbkeys.
The following example:
EMP_ID_0415 = EMP_ID_IN; FIND CALC RECORD (EMPLOYEE); ACCEPT CURRENCY INTO (SAVED_DBKEY) PAGE_INFO INTO (SAVED_PGINFO); . . . OBTAIN DBKEY (SAVED_DBKEY);
Upon completion of the ACCEPT DBKEY FROM CURRENCY function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request was serviced successfully.
Currency was not established for the named record or set.
The subschema does not contain the named record or set. Your program probably invoked the wrong subschema.
The subschema does not contain the named area.
|
Copyright © 2014 CA.
All rights reserved.
|
|