In this topic, we described about the below sections -
The RELEASE statement transfers records from an input/output area to the sorting operation initial phase. The RELEASE statement used only within the range of an INPUT PROCEDURE associated with a SORT statement. At least one RELEASE statement must be specified within an INPUT PROCEDURE.
When the RELEASE statement is executed, the current contents of record-name-1 are placed in the sort file. This process makes the record available to the initial phase of the sorting operation.
Specifies the name of a logical record in a sort-merge file description entry (SD). record-name-1 can be qualified.
FROM phrase -
Specifies the data area that is not previously moved to record-name-1. The FROM identifier-1 phrase is equivalent to the execution of the following statements -
MOVE identifier-1 to record-name-1. RELEASE record-name-1.
identifier-1 must reference one of the following -
- An entry in the working-storage section, or the linkage section.
- A record description for another previously opened file.
- An alphanumeric function.
identifier-1 and record-name-1 should not refer to the same storage area. After the RELEASE statement is executed, the information is still available in identifier-1.
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.
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.