Read - Control Data Corporation 3300 Reference Manual

Computer systems usasi cobol/ master
Table of Contents

Advertisement

4.7.18
READ
60229400
The READ statement makes the next logical record available from an input
file and allows performance of a specified imperative statement when end of
file is detected.
Format 1: (for sequential files from any device)
READ file-name RECORD [INTO identifier-I]
; AT END imperative-statement
Format 2: (for random access mass storage files only)
READ file-name RECORD [INTO identifier-I]
; INVALID KEY imperative-statement
An OPEN statement must be executed for a file prior to execution of the first
READ statement for that file.
If
INTO is specified, the data is read into both the record area and the area
specified by identifier-I.
Format 1:
If
the logical end of the file is reached during execution of a READ, and an
attempt is made to read that file, the AT END imperative statement is exe-
cuted. Files assigned to TTY and CRT have no end-of-file condition, so the
AT END phrase is never executed. Following execution of the AT END
imperative statement, a READ statement for that file must not be given unless
a prior CLOSE and OPEN for the file have been executed.
When a file consists of more than one type of logical record, these records
automatically share the same storage area; this is equivalent to an implicit
redefinition of the area. Only the information present in the current record
is accessible.
If
a file described with the OPTIONAL clause is not present, the imperative
statement in the AT END phrase is executed on the first READ and standard
end-of-file procedures are not performed.
If
the end of a tape reel is recognized during execution of a READ statement on
a multi-reel/unit file, the following operations are carried out:
4-51

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 3300 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

3500

Table of Contents