INTO/FROM Identifier Phrase

This phrase is valid for READ, RETURN, RELEASE, REWRITE, and WRITE statements. The identifier specified must be the name of an entry in the Working-Storage, Local-Storage or the Linkage Sections, or of a record description for another previously opened file. Record-name, identifier must not refer to the same storage area.

Read syntax diagramSkip visual syntax diagram
INTO/FROM Identifier Phrase - Format

>>-+-+-READ---+--file-name-1--+--------+--+--------------------+-+-><
   | '-RETURN-'               '-RECORD-'  '-INTO--identifier-1-' |   
   '-+-RELEASE-+--record-name-1--+--------------------+----------'   
     +-REWRITE-+                 '-FROM--identifier-1-'              
     '-WRITE---'                                                     

The result of the execution of a READ or RETURN statement with the INTO phrase is equivalent to the application of the following rules in the order specified:
  1. The execution of the same READ or RETURN statement without the INTO phrase.
  2. The current record is moved from the record area to identifier-1 according to the rules for the MOVE statement without the CORRESPONDING phrase. The size of the current record is determined by rules specified in the RECORD clause. If the file description entry contains a RECORD IS VARYING clause, the implied move is a group move. The implied MOVE statement does not occur if the execution of the READ or RETURN statement was unsuccessful. Any subscripting or reference modification associated with identifier-1 is evaluated after the record has been read or returned and immediately before it is moved to the data item. The record is available both in the record area and in identifier-1.
The result of the execution of a RELEASE, REWRITE, or WRITE statement with the FROM phrase is equivalent to the execution of the following statements in the order specified:
  1. The statement
    MOVE identifier-1 TO record-name-1
    according to the rules specified for the MOVE statement.
  2. The same RELEASE, REWRITE, or WRITE statement without the FROM phrase.

After the execution of the RELEASE, REWRITE or WRITE statement is complete, the information in identifier-1 is available, but the information in record-name-1 is not available, except as specified by the SAME RECORD AREA clause.