contents.gifindex.gifprev1.gifnext1.gif

Database Concepts

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 acu90000.gifacu90001.gifacu90001.gifacu90001.gifacu90002.gif Database

File acu90000.gifacu90001.gifacu90001.gifacu90001.gifacu90001.gifacu90001.gifacu90002.gif Table

Record acu90000.gifacu90001.gifacu90001.gifacu90001.gifacu90001.gifacu90002.gif Row

Field acu90000.gifacu90001.gifacu90001.gifacu90001.gifacu90001.gifacu90001.gifacu90002.gif Column

* 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, 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:
terms_code      terms_rate      terms_days      terms_descript
234             1.500           10              net 10
235             1.750           10              net 10
245             2.000           30              net 30
255             1.500           15              net 15
236             2.125           10              net 10
237             2.500           10              net 10
256             2.000           15              net 15
Each row is an instance of the 01 level record terms-record.