Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 10274
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 Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us