View previous topic :: View next topic
|
Author |
Message |
kumar32149
New User
Joined: 22 Sep 2010 Posts: 9 Location: India
|
|
|
|
Please read the following sample data for master file and transaction file and advise me on this issue.
file 1 is master file and file2 is transaction file. I would like to merge two files based on the account number but I want duplicate records from transaction file.
file 1
SNO ACCNUM
1 100
2 101
3 102
4 103
file 2
ACCNUM AMOUNT DATE
100 200 1/1/2010
101 321 2/2/2010
101 400 2/2/2010
102 700 3/2/2010
output
sno accnum amount date
1 100 200 1/1/2010
2 101 321 2/2/2010
3 400 2/2/2010
4 102 700 3/2/2010 |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Other than what appears to be a typo in your output example, this seems to be a relatively simple process. I don't understand what you're asking for assistance on? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Sort both files on accnum and then download the sample 2-file match/merge code from the "Sticky" at the top of this COBOL part of the forum.
With minor modification, the sample code will do what you want.
Possibly i misunderstand what you are looking for. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to sort the files before using the match/merge code. . .
The code in the "Sticky" has handled more than 500 million records. . . Why do you believe the code would be different for larger or smaller volumes of data? |
|
Back to top |
|
|
kumar32149
New User
Joined: 22 Sep 2010 Posts: 9 Location: India
|
|
|
|
sorry for wrong question actually i should achive this without SORT Utility
am asking cobol logic for this |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You are going to have an ugly experience in IT if you do not learn to read what you have been given and apply this. . .
I told you where to find the COBOL code to do this. Just download it (right-click save-as), modify for your specifics, and run it. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
|