View previous topic :: View next topic
|
Author |
Message |
sahil mohta
New User
Joined: 25 Jul 2008 Posts: 5 Location: pune
|
|
|
|
Hi all,
I am having two KSDS files whose records i have to match and
according to certain conditions.
The files contains records like:-
file1:-
111 as mike
222 wet neal
333 of rober
444 yes thomas
555 newton
file2:-
888 why sam
222 wet neal
444 the tom
555 see kelvin
666 no gery
conditions:-
a). Account no.present in file1 and not in file2 be written to output with Insert indicartor as “I”.
b.) Account no.present in file2 and not in file1 will be written to output with Delete indicator as “D”.
c.) Account no.are same in both file1 and file2 but the Other Feilds differ than Ind will be compared. If the data is changed, then the record will be written to output with Update ind as “U”.
d.) Account no. present in both file1 and file2 and also the other feilds are same then the record will be ignored.
So now the output file should be like this :-
output file :-
111 as mike I
333 of rober I
444 yes thomas U
555 newton U
888 why sam D
444 the tom U
555 see kelvin U
666 no gery D
so this is my problem, that how can i get this output?
Help me out..
Thanks & Regards. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
check for the 'sticky' in the Mainframe COBOL forum for match-merge.
that is an example of logic to compare two files. |
|
Back to top |
|
|
rpuhlman
New User
Joined: 11 Jun 2007 Posts: 80 Location: Columbus, Ohio
|
|
|
|
Hi Sahil,
Multiple file matches are a fairly common process requirement. Dick Scherrer has posted a "Sticky" titled "2-File Match/Merge sample code", at the top of the Mainframe COBOL forum, which contains an example. Study the example to get the basic logic. Then model and modify the code to meet your requirements. If you still have questions/problems, after you have attempted to code, compile, and test your program, please post them along with any pertinent detail info and we will be happy to help.
Rick |
|
Back to top |
|
|
|