COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-27
FROM Phrase
FROM Phrase
The FROM phrase is an optional component of the RELEASE, REWRITE, and WRITE
statements, all of which specify a record-name as their primary operand. The identifier
in the FROM phrase and the record-name must not reference the same storage area
or overlapping storage areas.
The result of executing a statement that specifies the FROM phrase is equivalent to
the execution of these statements in this order:
1. “MOVE identifier TO record-name” executed in accordance with the rules specified
for the MOVE statement
2. The same RELEASE, REWRITE, or WRITE statement without the FROM phrase
After execution of the actual statement is complete, the information in the storage area
specified by the identifier is available, even though the information in the area specified
by record-name is not available (except as specified by the SAME AREA clause).
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).
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.