But doing it COBOL puts a big questionmark on why should we write something which is already available through some utility.
If some utility or sort can do 100% of the requirement there is not much question (providing your organization permits using the full features of the sort or utility). I have been asked several times to look into "poor performance" and found that "someone" had implemented a process by using 5 or more sort/utility processes to do what one actually coded program could do. This caused hundreds of millions of records to be passed multiple times.
Someone who is familiar with both the requirement and the tools available should participate in the implementation decision. There is no one "right answer" - it depends on the specifics.
Much (actually most) of the time one sort or utility step does not meet the full
requirement. Some things shold be done with code.
The updates and insert will be done on Table .
How are these updates to be accomplished? Is this possibly a typo? What % of the rows in the table will typically be inserted/updated? You mention what shouold happen if a value isin one file and not the other. What happens when the value is in both files? What about duplicatges? Etc, etc, etc. . .