Processing files
Processing data
is an essential part of every program.
Your program retrieves information, processes it as you request, and
then produces the results.
The source of the information and the target for the results can be one or more of the following items:
- Another program
Hierarchical or relational database
Messages from subsystem software
- Direct-access storage device
- Magnetic tape
- Printer
- Terminal
- Card reader or punch
The information as it exists on an external device might be in
a physical record or block, a collection
of information that is handled as a unit by the system during input
or output operations.
Your COBOL program does not directly handle physical records. It processes logical records. A logical record can correspond to a complete physical record, part of a physical record, or to parts or all of one or more physical records. Your COBOL program handles logical records exactly as you have defined them.
In COBOL, a collection of logical records is a file, a sequence of pieces of information that your program can process.