Function
The RELEASE statement transfers records from the input file to the sort-file. It can only be used during a sort operation.
Format
RELEASE sort-record-name [FROM identifier]
Syntax rules
sort-record-name must be the name of a logical record in the associated sort-file description.
sort-record-name and identifier must not refer to the same internal storage area.
General rules
Execution of a RELEASE statement has the effect that the record specified by sort-record-name is transferred to the sort-file, to be further processed by the SORT routine of the system.
The FROM phrase makes the RELEASE statement equivalent to a MOVE statement followed by a RELEASE statement.
When this phrase is written, data is moved from the area specified by identifier to the area identified by sort-record-name, and is then released to the sort-file. The move takes place according to the rules which govern the MOVE statement without the CORRESPONDING phrase.A RELEASE statement may be used only within an input procedure in connection with a SORT statement for the sort file containing sort-record-name.
After a RELEASE statement is executed, the logical record is no longer available in the record area, unless the associated sort-file, appears in a SAME RECORD AREA clause. The logical record is, also at program execution time, available as a record of other files specified in the SAME RECORD AREA clause as the associated sort-file; and it is available to the file associated with sort-record-name. When control is transferred to the input procedure, that file consists of all those records which were passed by means of the execution of RELEASE statements.
After a RELEASE statement with the FROM phrase is executed, the record is still available in "identifier".