Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / leo

Using matching logic:

perform following code until either of EOF is found.

EVALUATE TRUE

WHEN KEY1> KEY2
READ FILE2
WHEN KEY2> KEY1
READ FILE1
WHEN KEY1=KEY2
WRITE FILE3 (WHATEVER FORMAT YOU WANT)
READ FILE1
READ FILE 2

END-EVALUATE

You can perform above code until both EOF found, incase you
need to create another file for non matching records. for
matching records only performing until either of EOF will
work.

~LEO

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why would you use find and get rather than to obtain?

1187


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

2011


What is the difference between comp and comp-3?

1185


What is the utilization of copybook in cobol?

1194


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

2110


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

1153


What is the difference between perform … with test after and perform … with test before?

1455


Write a program to explain size error.

1200


Difference between cobol and cobol-ii?

1279


What is amode(24)?

1241


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1506


What are the different types of condition in cobol and write their forms.

1115


What is the difference between comp and comp-3 usage?

1201


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

1238


What are the different rules to perform a Search?

1098