COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
INTO Phrase
The INTO phrase is an optional component of the READ and RETURN statements, both of which
specify a file name as their primary operand. This phrase can be specified in a READ or RETURN
statement only if either:
• The specified file has only one associated record description entry.
• The data description entry for the data item specified by the identifier in the INTO phrase and
all record description entries associated with the file describe data structures or elementary
alphanumeric items.
The storage area specified by the identifier in the INTO phrase must not be the same as or overlap
the record area associated with the file identified by the file name.
The result of executing a statement that specifies the INTO phrase is equivalent to:
1. Execution of the same READ or RETURN statement without the INTO phrase (which obtains a
logical record of the file)
2. After successful execution of the READ or RETURN statement, assignment of the current record
in the file record area to the data item specified by the identifier in accordance with the rules
for the MOVE statement; therefore (except for a destination described with the JUSTIFIED
clause), long records are truncated at the right, and short records are padded at the right with
spaces according to the standard alignment rules.
The size of the current record is the size of the record when it was written (see RECORD CONTAINS
Clause (page 163)).
The record is then available in both the record area of the file and the storage area associated
with the data item specified by the identifier. The move operation does not occur unless execution
of the READ or RETURN statement was successful.
Input-Output
These topics are common to several input-output statements:
• I-O Status Code
• Diagnosing Input-Output Errors
• Recovering from Input-Output Errors
• Timed Input and Output
I-O Status Code
Each file-control entry can include a FILE STATUS clause that designates a 2-character file-status
data item declared elsewhere in the program as the receptacle for that file’s I-O status code. The
leftmost character position of the file-status data item is Status Key 1. The rightmost character
position of the file-status data item is Status Key 2.
Whenever a program executes a CLOSE, DELETE, LOCKFILE, OPEN, READ, REWRITE, START,
UNLOCKFILE, UNLOCKRECORD, or WRITE statement for a file that has a FILE STATUS clause, the
run-time routines record the I-O status code in the specified file-status data item. The storage
operation occurs prior to the execution of any applicable USE procedure or any applicable
imperative statement associated with the input-output statement (in AT END, NOT AT END, INVALID
KEY, or NOT INVALID KEY phrases).
The I-O status code indicates the success or failure of the input-output statement, and (if failure),
the reason for the failure. Table 43 through Table 48 show the possible values of the file-status
data item.
Input-Output 247










