I have the requirement to compare the two files and pick up
the matching records.
File 1. file2

23 32
32 13
34 15
35 36
36 35
43

Get the matching records from this 2 files to out file. how
you will do this in cobol program?

Answer Posted / harsha

First merge bothe file.
Use sort card
//Sysin dd *
sort fields=-------
Sum fields=(none,xsum)
/*

File mentioned in SORTXSUM dd name will contain matching
records.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between external and global variables in COBOL?

810


How do you define a variable of comp-1 and comp-2?

699


What are the different rules for performing sort operation?

757


How many bytes S(8) comp field occupy and its maximum value?

1626


Which is not true about evaluate statement

1567






There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

928


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2718


How to remove 2 duplicate records and copy only one using job control language?

736


A table has two indexes defined. Which one will be used by the SEARCH?

752


Whats the difference between search & search ALL?

5251


What are the various section in data division and briefly explain them.

692


What is the default value(s) for an initialize and what keyword allows for an override of the default?

691


how to refer the data field?

1802


What is amode(31)

716


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

697