Purpose
Saves the database key and, optionally, the page information of the next, prior, or owner record relative to the current record of a set.
Syntax
►►─── ACCept DB-KEY into db-key-variable - FROM set-name ─┬─ NEXT ──┬►
├─ PRIOR ─┤
└─ OWNER ─┘
►──── CURRENCY ─────┬─────────────────────────────────────┬──────────►
└─ PAGE-INFO into page-info-variable ─┘
►───┬────────────────────┬─────────────────────────── . ───────────►◄
└─ error-expression ─┘
Parameters
Specifies the variable data field to which the database key of the object record is moved.
Db-key-variable is a PIC S9(8) COMP SYNC.
Db-key-variable must be a binary fullword field that is defined in a record associated with the dialog.
Specifies the record whose database key is moved to the field identified by db-key-variable.
Set-name must be known to the dialog's subschema.
Saves the database key of the next record relative to the current record of the specified set.
A request for NEXT CURRENCY cannot be specified unless the object set has prior pointers, which ensure that the next pointer in the prefix of the current record does not point to a logically deleted record.
Saves the database key of the prior record relative to the current record of the specified set.
A request for PRIOR CURRENCY cannot be specified unless the object set has prior pointers.
Note: No indication of an end-of-set condition is possible for an ACCEPT NEXT or ACCEPT PRIOR command. A retrieval command must be issued to determine whether the next or prior record in the specified set is the owner record.
Saves the database key of the owner of the current record of the specified set.
A request for OWNER CURRENCY cannot be specified unless the object set has owner pointers. If the current record is the owner of the specified set, a request for OWNER CURRENCY returns the database key of the current record, even if the set does not have owner pointers.
Specifies the current record of run unit, record type, set, or area.
Specifies the variable data field to which the page information of the named record is moved.
A four-byte field that is defined either as a group field or as a fullword field (PIC S9(8) COMP). This parameter identifies the variable data field to contain the 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.
Specifies the status codes that are returned to the dialog.
Usage
Definition
The ACCEPT DB-KEY RELATIVE TO CURRENCY command is used to move the database key and, optionally, the page information of the next, prior, or owner record relative to the current record of set to a specified location in a dialog's record buffers.
This command allows a process to save the database key of a record without accessing the record itself. A subsequent FIND/OBTAIN DB-KEY command can use the saved database key to access the record directly. FIND/OBTAIN DB-KEY is described later in this section.
Note: You must establish currency before using this statement. If no set currency has been established, the DBMS returns 0000 to the ERROR-STATUS field and -1 to the db-key field. NEXT, PRIOR, and OWNER CURRENCY cannot be requested for sets defined for native VSAM records.
If autostatus is not in use, a dialog's error-status field indicates the outcome of an ACCEPT DB-KEY RELATIVE TO CURRENCY command:
|
Status code |
Meaning |
|---|---|
|
0000 |
The request was executed successfully |
|
1506 |
Currency was not established for the object set |
|
1508 |
The object record is not in the dialog's subschema |
Example
The statements in the following example establish a current ITEM record and save the database key of the owner record of the PRODUCT-ITEM set in the field SAVE-KEY:
MOVE 1230407 TO ORD-NUMBER. FIND CALC ORDOR. FIND NEXT WITHIN ORDER-ITEM. ACCEPT DB-KEY INTO SAVE-KEY FROM PRODUCT-ITEM OWNER CURRENCY.
|
Copyright © 2014 CA.
All rights reserved.
|
|