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

Write a program to enter and display the names of students in a class using the occurs clause.

1158


What are the different rules for performing sort operation?

1157


What is the difference between comp and comp-3?

1135


Explain the configuration section of a cobol program with examples of syntax.

1125


What do you understand by psb and acb?

1062


What is a SSRANGE and NOSSRANGE?

1417


What are the different rules to perform a Search?

1050


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1224


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2918


What are 77 levels used for?

1055


Define cobol?

1314


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

2487


Which division and paragraphs are mandatory for a COBOL program?

1200


How do define dynamic array in cobol.

1087


HOw can I get the negative sign while deduct high value from low value

2213