Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to find the duplicate dataset using cobol code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to find the duplicate dataset using cobol code
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    Post subject: Hi
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10457
Location: italy

PostPosted: Tue Dec 23, 2008 2:35 pm    Post subject: Reply to: How to find the duplicate dataset using cobol code
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

Senior Member


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

PostPosted: Tue Dec 23, 2008 5:28 pm    Post subject:
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

Site Director


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

PostPosted: Tue Dec 23, 2008 10:56 pm    Post subject:
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    Post subject:
Reply with quote

Hi Sathya,

See if this helps:

1. Sort the file in Cobol; refer to http://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

Senior Member


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

PostPosted: Wed Dec 24, 2008 10:07 am    Post subject:
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

Site Director


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

PostPosted: Wed Dec 24, 2008 10:13 am    Post subject:
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    Post subject: Reply to: How to find the duplicate dataset using cobol code
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

Site Director


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

PostPosted: Sat Dec 27, 2008 12:17 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts Getting GG return code abdulrafi IMS DB/DC 2 Tue Apr 10, 2018 12:31 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us