Processing files

Start of changeProcessing dataEnd of change 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
  • Start of changeHierarchical or relational database End of change
  • Start of changeMessages from subsystem softwareEnd of change
  • Direct-access storage device
  • Magnetic tape
  • Printer
  • Terminal
  • Card reader or punch

The information as it exists on an external device Start of changemight be inEnd of change 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.