Technical data

5.4 Database Records
A database record, like a record in a file, is a named collection of elementary
database data items. Records appear in the database as record occurrences.
Oracle CODASYL DBMS records are linked into sets.
In HP COBOL database applications, you do not describe database records in
the COBOL program. Rather, you must use the DB statement to extract and
translate subschema record definitions into your COBOL program as COBOL
record definitions.
Each record description entry defined by the DBA in the schema describes one
record type (see Section 5.7). For example, in Figure 5–7, PART is one record
type and SUPPLY is another record type. Any number of records can be stored in
a database.
In Oracle CODASYL DBMS, records are also called record occurrences.
Figure 5–6 shows one occurrence of PART record type and two occurrences
of SUPPLY record type.
The subschema describes records that you can access in your program. Note
that subschema record descriptions might define only a portion of a schema
record. For example, if a schema record description is 200 characters long, a
corresponding subschema record description could be less than 200 characters
long and use different data types.
Individual database records are locked by the DBCS as they are retrieved by the
run unit, and the degree of locking depends on the specific DML command used.
For more information, see Section 6.1.1.
5.5 Database Data Item
A database data item is the smallest unit of named data. Data items occur in the
database as data values. These values can be character strings or any of several
numeric data types.
5.6 Database Key
A database key (dbkey) identifies a record in the database. The value of the
database key is the storage address of the database record. You can use this key
to refer to the record pointed to by a currency indicator or an entry in a keeplist.
For example, KEEP, FIND ALL, and FREE statements store and release these
values from a keeplist you define in the subschema section.
5.7 Record Types
Records are grouped according to common features into record types. The
database administrator (DBA) describes record types in the schema; record
occurrences exist in the database. For example, a record that contains a specific
part name, weight, and cost is a record occurrence. The PART record type,
describing the structure of all occurrences of part records, would be defined in the
schema. The unqualified term record implies record occurrence.
Database Programming with HP COBOL 5–5