IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find the duplicate dataset using cobol code


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sathya.P

New User


Joined: 17 Sep 2007
Posts: 6
Location: chennai

PostPosted: Tue Dec 23, 2008 2:33 pm
Reply with quote

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
View user's profile Send private message
sathya.P

New User


Joined: 17 Sep 2007
Posts: 6
Location: chennai

PostPosted: Tue Dec 23, 2008 2:34 pm
Reply with quote

I forgot to mention in my previous note, i need to do this using COBOL Code.

Thanks,
Sathya.P
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Dec 23, 2008 2:35 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 23, 2008 5:28 pm
Reply with quote

Hi,

You want to "destroy" the input file itself or you want the output in other file ?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 23, 2008 10:56 pm
Reply with quote

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
View user's profile Send private message
rahulvv

New User


Joined: 05 Apr 2006
Posts: 3
Location: Mumbai, India

PostPosted: Wed Dec 24, 2008 9:58 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Dec 24, 2008 10:07 am
Reply with quote

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.. icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 24, 2008 10:13 am
Reply with quote

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
View user's profile Send private message
sathya.P

New User


Joined: 17 Sep 2007
Posts: 6
Location: chennai

PostPosted: Fri Dec 26, 2008 4:39 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Dec 27, 2008 12:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top