Technical data

Table 2–1 COBOL Database-Related User-Defined Words
User-Defined Word
Set Purpose
Keeplist-name Names a list of database keys used by the run unit to lock records for later use.
Realm-name Names a database realm. (See the READY statement in the Procedure Division
chapter.)
Schema-name Names a database schema. (See the DB statement in the Data Division chapter.)
Set-name Identifies a database set type.
Sub-schema-name Names a database subschema. (See the DB statement in the Data Division
chapter.)
Record-name Names a database record type.
Data-item-name Names a data-item that is defined for a record type.
2.2 Database-Related Reserved Words
A reserved word can be used only as specified in the general formats. It cannot
be a user-defined word. (See the appendix that lists Reserved Words.) Among the
COBOL reserved words are required words, optional words, and special-purpose
words. One of the special-purpose words, DB-CONDITION, is of special interest
to the database programmer.
2.2.1 DB-CONDITION
The reserved word DB-CONDITION names a database exception condition
register. It is a longword COMP item represented by PIC S9(9) USAGE IS
COMP. The execution of every COBOL data manipulation language (DML)
statement causes the Database Control System (DBCS) to place a status code
value in this register indicating either a successful condition or an exception
condition.
Before the program executes the first DML statement, the value of DB-
CONDITION is initialized to DBM$_NOT_BOUND. For an explanation of this
and other Oracle CODASYL DBMS status codes, refer to the Oracle CODASYL
DBMS documentation set.
If a DML statement causes an exception condition, the return status code in
DB-CONDITION equals the condition value. If the execution of a DML statement
does not result in a database exception condition, DB-CONDITION contains a
successful return status. Procedure Division statements can access the values in
this register; however, only the DBCS can change the value.
2.2.2 DB-CURRENT-RECORD-NAME
This reserved word names a database register. It consists of 31 alphanumeric
characters represented by PIC X(31) USAGE IS DISPLAY. The execution of
COBOL data manipulation language (DML) statements that alter currency
indicators causes the Database Control System (DBCS) to place a value in this
register.
If the currency indicator for the run unit is not null, the register contains the
name of the record type of the current record of the run unit. If the currency
indicator for the run unit is null, the register contains spaces. Procedure Division
statements can access the values in this register; however, only the DBCS can
change the value.
2–2 Database Programming Elements of HP COBOL