Monday, 28 July 2014

COBOL MERGE

Merging is commonly used when data files having the same form of data have to be combined to form a larger unit for processing. A common example is the processing at the head office of data from branch offices. The branch offices send files containing their data to the head office and at the end of the month the head office merges this data and generates a consolidated report. Refer below figure.



The MERGE statement combines two or more identically sequenced files (that is, files that have already been sorted according to an identical set of ascending/descending keys) on one or more keys and makes records available in merged order to an output procedure or output file. Similar to the SORT statement, the MERGE statement also handles opening, closing of files and reading and writing data from and to files automatically.

Format : 


Example :



Created with Artisteer

No comments:

Post a comment