Rocket® Visual COBOL® (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.
Database Concepts
Restriction: This topic applies only when a Database Connectors license has been installed via
the Micro Focus License Management System.
Relational databases differ from indexed file systems in several significant ways. These are the logical associations between database concepts and COBOL indexed file concepts:
| Indexed File Concept | Database Concept |
|---|---|
| Directory | Database |
| File | Table |
| Record | Row |
| Field | Column |
Or, put another way:
- Database operations are performed on columns. Indexed file operations are performed on records
- A COBOL indexed file is logically represented in database table format. Within a table, each column represents one COBOL field; each row represents one COBOL record
- Database table columns are strictly associated with a particular data type, such as date, integer, or character. In COBOL, data can have multiple type definitions
For example, for Oracle, a COBOL record that looks like this:
01 terms-record.
03 terms-code pic 999.
03 terms-rate pic s9v999.
03 terms-days pic 9(2).
03 terms-descript pic x(15).
would be represented in the database as a table with a format similar to this:
| Name | Null | Type |
|---|---|---|
| TERMS_CODE | NOT NULL | NUMBER (3) |
| TERMS_RATE | – | NUMBER (4, 3) |
| TERMS_DAYS | – | NUMBER (2) |
| TERMS_DESCRIPT | – | CHAR (15) |