Chapter 5. Diskette Input/Output; Input-Output Summary; File Organization And Access Method - IBM 5280 Programmer's Manual

Distributed data system, cobol
Hide thumbs Also See for 5280:
Table of Contents

Advertisement

Input-Output Summary
Chapter 5. Diskette Input/Output
Diskette Input/Output (I/O) is the transfer of data between a program and
IBM 5280 diskette devices. The chapter provides examples of the statements
you write to perform diskette I/O, and some considerations you must make in
writing I/O routines, namely:
Choosing a file organization (sequential, relative, or indexed)
Choosing the access method (sequential or random)
Assigning data sets and devices to file statements in the program
Sharing files among more than one program
Guidelines and examples in coding routines to create, read, and update
the three types of file organizations
A COBOL I/O operation that transmits data to or from main storage involves
three elements:
The COBOL statements that define and request the operation
An access method that performs the operation
A file on an actual device on which the operation is performed
To perform a diskette I/O operation, you must code several statements in your
program to make the operation possible. Some of these statements are:
The FILE-CONTROL paragraph, which relates your file to the diskette
device, and describes the access mode, file organization, and other
factors relating to the file.
The OPEN and CLOSE verbs in the Procedure Division. OPEN builds
the environment necessary to transmit data to and from a device;
CLOSE completes all unfinished I/O operations.
Before attempting to transmit data, you must always issue an OPEN;
you should always issue a CLOSE to ensure that any data remaining in
an intermediate buffer is transferred.
READ, WRITE, REWRITE, and DELETE verbs in the Procedure
Division that cause records to be transmitted either to or from the files
you specify in the ASSIGN clause.
The remainder of the chapter provides more detailed information on the items
just summarized.
File Organization and Access Method
You define a file organization and an access method in the FILE-CONTROL
paragraph of your program. The types of file organizations and access
methods you can define are:
Sequential, for which one access method is possible: sequential. For
this organization, you specify ORGANIZATION IS SEQUENTIAL in
the FILE-CONTROL paragraph of your program.
Chapter 5. Diskette Input/Output
5- 1

Advertisement

Table of Contents
loading

Table of Contents