Technical data

LD (Keeplist Description)
LD (Keeplist Description)
Function
The Keeplist Description entry names a keeplist.
General Format
LD keeplist-name [ LIMIT IS integer ] .
keeplist-name
is a user-defined name.
integer
is a positive integer.
Syntax Rules
1. The LD entry can appear only in the Subschema Section following the DB
entry or another LD entry.
2. The LIMIT clause is for documentation only. The compiler ignores this clause.
General Rules
1. Keeplist-name implicitly has the global attribute. Any program defining
the name, and any program contained within that defining program, can
reference keeplist-name.
2. A keeplist is a table containing an ordered list of database key values.
3. At program initiation, each existing keeplist is empty.
4. A KEEP or a FIND ALL statement adds a database key value to the end of
keeplist-name. FIND ALL can add multiple database keys to a keeplist.
5. A FREE statement selectively removes a database key value from keeplist-
name.
6. A keeplist with zero entries is called an empty keeplist. The order of the
entries in the keeplist reflects their sequence of insertion. As entries are
added, the cardinality increases. As entries are removed, the cardinality
decreases.
7. A COBOL program can reference a keeplist entry by using a database key
identifier.
8. The Database Control System (DBCS) creates and maintains all keeplists.
9. Each value in keeplist-name represents a database record in the database.
10. A keeplist can contain the same database key value more than once.
11. More than one keeplist can contain the same database key value at the same
time.
12. No other run unit can update a record whose database key value is in a
keeplist. Every entry in the keeplist causes the DBCS to perform a retrieval
lock on the record it identifies. The record remains locked until the entry is
freed, or until the program executes a COMMIT (without the RETAINING
option) or ROLLBACK statement, or until the program terminates. If another
run unit references a locked record, the DBCS forces the run unit to wait
until the record is unlocked.
Data Division 3–9