i have a file of record layout contains:
scenario:i needs to check file accounts with the database accounts.
For the same group number in the file, first i needs to get the first
account number from file. using the account number i will fetch the table
to get the group number, using the same i will get the
bunch of account numbers from table for the particular group number.
so now i needs to compare both the file account numbers and table account numbers, if there is any mismatching i needs to write it to a output file.
if there is one mismatch for the particular group number from both
file and table or additional accounts present in the table also those bunch
of records from file and table i needs to write.
suggest me a logic that writes the records to file for mismatches in file
and table account numbers.
You have a INPUT FILE which contains GROUP & ACCOUNT numbers.
You need to find only the mis-match.
You will get the ACCOUNT number from the file and search it in the table.
And compare the GROUP number from the table with the GROUP number in the file.
If they match you will do some process.
If they don't match you will do some other process.
If this is the case.
READ the file. get the account number & group number
Do a fetch for that account number,
compare the file-group-number & table-group-number
if they match
do the process
do the process
write it to a output-file
I guess you need the mismatched 'groups' along with the corresponding 'accounts' from both the table as well as the file. But I am still not clear what exactly you want in output.
What do you expect in output for the below cases.
1. For a particular group-all accounts in the table are matching with that in the input file.
2. For a particular group-table has some additional accounts.
3. For a particular group-file has some additional accounts.
4. Entire group is missing-either in file or table.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
For people here to be better able to help you need to post some sample input from all of the input sources and the output you want when the process is run on that sample input. Your sample input needs to show all combinations that the process needs to handle and the output needs to show how it was handled.
The single biggest factor in getting help here is how well you present the requirement.