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

How can you get the ksds file records into your cobol program?

1138


What are the different rules to perform a Search?

1144


How do you get the data to code the BMS macro?

2016


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1219


Mention the guidelines to write a structured cobol program?

1144


What is the compute verb? How is it used?

1188


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

1307


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1280


What is perform what is varying?

1224


What is Pic 9v99 Indicates in COBOL?

1341


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2640


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

1386


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

10013


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

1484


Write a cobol program making use of the redefine clause.

1229