Technical data

FETCH Locates a record in the database, retrieves its data item
values, and places them in the user work area (UWA).
FREE Releases references to records.
GET Retrieves data item values of a previously located record
and places them in the user work area (UWA).
KEEP Remembers a record so you can later refer to it.
Records can be found in several ways in the database. By using a Record
Selection Expression in a FIND or FETCH statement, a program has four
formats to choose from: ( 1 ) database key identifier access, ( 2 ) set owner
access, ( 3 ) record search access, or ( 4 ) DB-KEY access. Chapter 4, Procedure
Division, explains these in detail.
A COBOL program can sequentially search the database or individual realm.
In all cases, once a record is found by the COBOL application program, the
DBCS sets a currency indicator to hold the database key value of that record
or the position of that record. The COBOL program can indirectly use this
value in KEEP, FIND ALL, or FREE statements or use the RETAINING
option as a placemarker to help the program navigate through the database.
Update—These functions allow the creation, modification, and deletion of
database records.
CONNECT Makes a record a member in one or more sets.
DISCONNECT Removes a record from one or more sets.
ERASE Deletes records from the database.
MODIFY Changes the contents of a record in the database.
RECONNECT Moves a record from one occurrence of a set type to
another (possibly the same) occurrence.
STORE Adds a record to the database.
Chapter 4 discusses the effects of the schema data definition language (DDL)
INSERTION and RETENTION options on each of the DML update verbs.
Once a record has been located by a COBOL program, it can be changed or
even erased from the database. DML programming operations also change the
fundamental relationships within sets, causing records to change as well. For
example, each set is owned by a record or Oracle CODASYL DBMS itself. If the
program erases a record that is the owner of the set, all member records may also
be deleted.
Section 4.5 contains more information on DML statements, database conditional
expressions, and the special registers DB-CONDITION, DB-CURRENT-RECORD-
NAME, DB-CURRENT-RECORD-ID, DB-UWA, and DB-KEY.
1.3 Creating an HP COBOL DML Program
When you create an HP COBOL DML program, you must include the SUB-
SCHEMA SECTION entry as the first section in the Data Division. The
SUB-SCHEMA SECTION is followed by a DB statement and any LD statements.
The Procedure Division contains all occurrences of the DML verbs.
1–4 Program Organization and Structure