View previous topic :: View next topic
|
Author |
Message |
sathya.P
New User
Joined: 17 Sep 2007 Posts: 6 Location: chennai
|
|
|
|
Hi ,
I need to delete the duplicate record by comparing one record with all other remaining records(whole record) in the file.
Thanks,
Sathya.P |
|
Back to top |
|
|
sathya.P
New User
Joined: 17 Sep 2007 Posts: 6 Location: chennai
|
|
|
|
I forgot to mention in my previous note, i need to do this using COBOL Code.
Thanks,
Sathya.P |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
what did You try/think about ?
first think about the logic, the program will follow,
but why not use sort to do it?? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
You want to "destroy" the input file itself or you want the output in other file ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I need to delete the duplicate record by comparing one record with all other remaining records(whole record) in the file. |
What progress has been made on this?
Have you decided how you will approach this task?
If you post some sample input and what you want for output when that input is processed, it may help define the requirement. . . |
|
Back to top |
|
|
rahulvv
New User
Joined: 05 Apr 2006 Posts: 3 Location: Mumbai, India
|
|
|
|
Hi Sathya,
See if this helps:
1. Sort the file in Cobol; refer to publibfp.boulder.ibm.com/epubs/pdf/igy3pg40.pdf
2. For each of the sorted record, subject it to the following logic:
if ws-var-prev = in-rec-data
continue
else
ws-var-prev = in-rec-data
write out-rec from in-rec-data
end-if
Do let me know, if any clarification is required.
Thanks,
Rahul |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Rahul,
The logic you told is about SORT or COBOL ? Seems like point 2 is for COBOL but both "IF" and "ELSE" condition-check look same to me.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Rahul was suggesting that the file first be sorted and then the pseudo code would be used in cobol to handle duplicates (as TS asked for a way to do this in cobol). |
|
Back to top |
|
|
sathya.P
New User
Joined: 17 Sep 2007 Posts: 6 Location: chennai
|
|
|
|
Hi,
My requirement is to identify duplicate records which are actullay header records within PS file. The record format is like we have a series of header records followed by its batch data.
Thanks
Sathya.P |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post some sample input that( includes all possible input cases) and the output you want when this input is processed. |
|
Back to top |
|
|
|