Purpose
Saves the database key and, optionally, the page information of the current record of run unit, record type, set, or area.
Syntax
►►── ACCept DB-KEY into db-key-variable - FROM ──┬─────────────────┬─────►
├─ record name ───┤
├─ set-name ──────┤
└─ area-name ─────┘
►─── 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.
Saves the database key of the record that is current of the specified record type.
Saves the database key of the record that is current of the specified set.
Saves the database key of the record that is current of the specified area.
Specifies the current record of run unit, record type, set, or area.
If no record, set, or area is specified, CA ADS saves the database key of the record that is current of run unit.
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 FROM CURRENCY command is used to move the database key and, optionally, the page information of the current record of run unit, record type, set, or area to a specified location in a dialog's record buffers. 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 currency has been established, the DBMS returns 0000 to the ERROR-STATUS field and -1 to the db-key field.
Considerations
If autostatus is not in use, a dialog's error-status field indicates the outcome of an ACCEPT DB-KEY FROM CURRENCY command:
|
Status code |
Meaning |
|---|---|
|
0000 |
The request was executed successfully |
|
1508 |
The object record is not in the dialog's subschema |
Example
The statements in the following example establish a PRODUCT record as current of run unit and save the record's database key in the field SAVE-DB-KEY:
MOVE 7690157 TO PROD-NUMBER. FIND CALC PRODUCT. ACCEPT DB-KEY INTO SAVE-DB-KEY FROM CURRENCY.
|
Copyright © 2014 CA.
All rights reserved.
|
|