What are INPUT PROCEDURE and OUTPUT PROCEDURE?
Ans: Sometimes, it is necessary that the records must be edited before or after the sorting. In such cases, SORT workfile ASC/DESC KEY key1, … INPUT PROCEDURE IS ipproc OUTPUT PROCEDURE is outproc Is used. In the INPUT PROCEDURE the input file is opened, records are read and edited and then are released to the sorting operation. Finally the file is closed. RELEASE sortrecname FROM inp-rec. In the OUTPUT PROCEDURE, output file is opened, the sorted record is returned to the Output record area and then the record is written. Finally the file is closed. RETURN workfile RECORD into out-rec.