The MERGE statement combines two or more identically sequenced files on a set of specified keys, and during the process makes records available, in merged order, to an output procedure or to an output file. open input file1 reversed output file2 perform read-file1 perform until eof-file1 write file2-rec from file1-rec perform read-file1 end-perform close file1 file2 stop run. How do you read a flat file in reverse order in COBOL? The format 2 SORT statement sorts table elements according to the specified table keys, and it is especially useful for tables used with SEARCH ALL. You can sort a table by using the format 2 SORT statement. The SORT statement creates a sort file by executing input procedures or by transferring records from another file, sorts the records in the sort file on a set of specified keys, and in the final phase of the sort operation, makes available each record from the sort file, in sorted order to some output procedures or to … How do you sort a table in COBOL? ![]() How can we sort in COBOL and declaration? Transfers the records present in the input-file to the work-file. Opens work-file in I-O mode, input-file in the INPUT mode and output-file in the OUTPUT mode. SORT work-file ON ASCENDING KEY rec-key1 USING input-file GIVING output-file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |