View previous topic :: View next topic
|
Author |
Message |
levaku Warnings : 1 New User
Joined: 03 Jul 2008 Posts: 5 Location: chennai
|
|
|
|
Hi,
i have a file of record layout contains:
group number
account number
scenario:i needs to check file accounts with the database accounts.
Expalnation:
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.
Warning: Do not Double Post. Duplicate deleted. |
|
Back to top |
|
|
levaku Warnings : 1 New User
Joined: 03 Jul 2008 Posts: 5 Location: chennai
|
|
|
|
hi,
i forgot to mention the input file is been soretd by group number and also while comparing in the program i am validating so many conditions. so i can't use search all.
suggest me on the same. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Kavitha,
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
else
do the process
write it to a output-file
perform read again till end-of-file.
END-READ.
Sushanth |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
levaku,
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. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
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. |
|
Back to top |
|
|
|