Reading data from files and writing data to files is an essential part of most COBOL programs. Your program can retrieve information, process it as you request, and then write the results.
Before the processing, however, you must identify the files and describe their physical structure, and indicate whether they are organized as sequential, relative, indexed, or line sequential. Identifying files entails naming the files and their file systems. You might also want to set up a file status field that you can later check to verify that the processing worked properly.
The major tasks you can perform in processing a file are first opening the file and then reading it, and (depending on the type of file organization and access) adding, replacing, or deleting records.
related concepts
File concepts and terminology
File systems
Generation data groups