I have dataset DS1 which has records say
1
2
3
4
5
...
...
etc

And also I have second dataset DS2 whcih has records
1
3
4
5
6
8
..
...

Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.

Answer Posted / harsha

Use following JCL
//STEP010 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEIN DD DSN=XXXXXXXXXXXXXX,DISP=SHR
//TOOLIN DD *
SELECT FROM(FILEIN) TO(UNIQFL) -
ON(1,73,CH) NODUPS
SELECT FROM(FILEIN) TO(DUPFL) -
ON(1,73,CH) ALLDUPS
/*
//*
//DUPFL DD SYSOUT=*
//UNIQFL DD SYSOUT=*
//*

Label DUPFL will show all duplicate records
Label UNIQFL will show all unique records

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static and dynamic call in cobol?

588


What is cobol?

736


What are the different rules to perform a Search?

613


How do we get current date from system with century in COBOL?

793


I have a File that has duplicate records. I need only those records that occur more than thrice.?

8616






What is link edit in cobol?

737


What is difference between static and dynamic call in cobol?

768


what is amode(24), amode(31), rmode(24) and rmode(any)?

688


What is a scope terminator give example?

652


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1921


What is comp-1 and comp-2?

754


Write a program to explain size error.

667


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

697


Can a Search can be done on a table with or without Index?

798


) How do u handle errors in BMS macro

1500