![]() |
VOOZH | about |
Internal Sequential files are often used in big data operational processing applications, necessitating the records to be arranged in an operational ascending or descending order. This ensures quick access to the data and makes it easier to retrieve. Furthermore, sorting data in a file or combining multiple files is a common operational requirement across applications. To effectively execute sequential internal processing, sorting is employed as a technique to arrange the given records in the desired order to have easy retrieval, and for fast accessing data.
Organizing data in a file or combining multiple files is a common operational need found in many applications. Sorting is a method used to sequence the provided records in either ascending or descending order to facilitate sequential internal processing.
this technique is used to arrange the given records in either operational ascending or descending order to be able to execute the sequential Internal processing.
There are two techniques in COBOL to sort the files:
The Sort verb takes input from a non-sequential file or internal procedure and produces output in an executed order to a file or internal procedure. this produces resultant output in an executed sequence to a file or internal known as procedures After the files have been sorted, operations such as adding, updating or deleting records can be performed.
Three Main files are used by the SORT verb to perform the sorting in COBOL :
The SORT verb requires three distinct files to complete the sorting task:
Syntax:
SORT work-files ON ASCENDING KEY res-key1
[ ON DESCENDING KEY res-key2 ]
USING input-files GIVING output-files
SORT verb performs the following operations:
The Merge verb in COBOL is used to compare the records from two or more easily sequenced files as well as classify them in one order. The operations for this include adding, updating, or deleting
Four Main files are used by the SORT verb for sorting in COBOL:
Syntax:
MERGE work-files ON ASCENDING KEY res-key1
[ ON DESCENDING KEY res-key2 ]
USING input-1, input-2 GIVING output-files
Merge Verb performs the following operations:
Example 1:
Output:
Key1 Data1 Key2 Data2 Key3 Data3 Key4 Data4 Key5 Data5