cobol

READ statement

Remarks#

The READ statement is a staple of COBOL transaction processing programming. Reads data from external storage into working store. With or without locks or sharing, sequentially, by random access, or by key. Declarative clauses for AT END may also be specified, but some programmers prefer explicit FILE STATUS testing.

As each file resource may contain any type of record in any given slot, COBOL is a “read a file”, “write a record” language, READ takes a filename (FD) and it is up to the programmer to place the record in an appropriate structure if heterogeneous data is saved in the file.

enter image description here

Simple READ from FD

READ data-file

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow