The RELEASE statement transfers records from an input/output area to the initial phase of a sorting operation.
The RELEASE statement can only be used within the range of an input procedure associated with a SORT statement.
RELEASE Statement - Format
>>-RELEASE--record-name-1--+--------------------+--------------><
'-FROM--identifier-1-'
Within an INPUT PROCEDURE, at least one RELEASE statement must be specified.
When the RELEASE statement is executed, the current contents of record-name-1 are placed in the sort file; that is, made available to the initial phase of the sorting operation.
+-------------------------------IBM Extension--------------------------------+
Can be a floating-point or date-time data item.
+----------------------------End of IBM Extension----------------------------+
MOVE identifier-1 to record-name-1 RELEASE record-name-1
Moving takes place according to the rules for the MOVE statement without the CORRESPONDING phrase.
Identifier-1 can be the name of an alphanumeric or DBCS function identifier.
+-------------------------------IBM Extension--------------------------------+
Identifier-1 must be a DBCS data item if record-name-1 is a DBCS data item.
Identifier-1 can be a floating-point or date-time data item.
+----------------------------End of IBM Extension----------------------------+
Record-name-1 and identifier-1 must not refer to the same storage area.
If the RELEASE statement is executed without specifying the SD entry for file-name-1 in a SAME RECORD AREA clause, the information in record-name-1 is no longer available.
If the SD entry is specified in a SAME RECORD AREA clause, record-name-1 is still available as a record of the other files named in that clause.
When FROM identifier-1 is specified, the information is still available in identifier-1.
When control passes from the INPUT PROCEDURE, the sort file consists of all those records placed in it by execution of RELEASE statements.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.