Technical data

KEEP
KEEP
Function
The KEEP statement inserts a database key value from a currency indicator or
keeplist into a keeplist.
General Format
KEEP
database-key-id
USING destination-keeplist
ON ERROR stment
NOT ON ERROR stment2
END-KEEP
database-key-id
represents a database key identifier. References are made to a keeplist entry or a
currency indicator according to the rules for Database Key Identifiers.
destination-keeplist
names a keeplist in the Subschema Section to receive the database key value.
stment
is an imperative statement executed for an on error condition.
stment2
is an imperative statement executed for a not on error condition.
General Rules
1. If database-key-id references a database key value in either a currency
indicator or a keeplist, the DBCS:
Inserts that value as the last entry in destination-keeplist
Sets a lock on the associated record to prevent concurrent run units from
accessing it
2. If the program does not specify database-key-id, the DBCS inserts the
database key value of the current record of the run unit as the last entry
of destination-keeplist.
3. The KEEP statement has no effect on currency indicators.
4. If a database exception condition occurs during the execution of a KEEP
statement, the DBCS places a database exception condition code in the
special register DB-CONDITION (see Technical Note). This code identifies
the condition.
Technical Note
KEEP statement execution can result in the database exception conditions
associated with the evaluation of the database key identifier.
Additional References
Section 2.2, on reserved words (database special registers)
Keeplist Description entry
HP COBOL Reference Manual, Chapter 6, section on scope of statements
Procedure Division 4–43