Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Coding input and output statements for files

After you identify and describe the files in the ENVIRONMENT DIVISION and the DATA DIVISION, you can process the file records in the PROCEDURE DIVISION of your program.

Code your COBOL program according to the types of files that you use, whether sequential, line sequential, indexed, or relative. The general format for coding input and output (as shown in the example referenced below) involves opening the file, reading it, writing information into it, and then closing it.

Example: COBOL coding for files

related tasks
Identifying files
Protecting against errors when opening files
Specifying a file organization and access mode
Setting up a field for file status
Describing the structure of a file in detail
Opening a file
Reading records from a file
Adding records to a file
Replacing records in a file
Deleting records from a file


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)