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
 

 

Elimate the duplicate record using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 37

PostPosted: Sat Jan 17, 2009 11:18 pm    Post subject: Elimate the duplicate record using SYNCSORT
Reply with quote

Hi,

I have a query. In my file i have got two records (duplicate) with same key values (first 13 bytes). My need is to retain the second record and eliminate the first record using SYNCSORT.

Below is the sort field positions.
SORT FIELDS=(1,13,CH,A)

Let me know how can i solve my above query using SYNCSORT.

Thanks
Sumu
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sun Jan 18, 2009 2:00 pm    Post subject:
Reply with quote

Have you read the manual to see what SUM FIELDS might do
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 10:00 am    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

Hi,

I know the use of SUM FIELDS and i have tried it out.

When we use SUM FIELDS = NONE, out of two similar key records, the record that comes first is kept and removes the second record.

But my query is that, is it possible to retain the second record and eliminate the first record, as the remaining datas (apart from key values) that comes in the second record is the latest.

I would like to know whether this is possible


Thanks
Sumeendar S
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: Mon Jan 19, 2009 10:16 am    Post subject:
Reply with quote

Hello,

How large is the file?

If it is small, try using a descending sort to remove duplicates and resort that output.

Which release of Syncsort are you using?
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 11:00 am    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

I am using SYNCSORT FOR Z/OS 1.3.1.0.

The file contains around 20, 000 records. Is it possible with this set of records.

So you are saying we have to use two sort cards. One using descending sort along with SUM FIELDS = NONE to remove duplicate and then use another sort card resort the above the set of records.

Let me know if this is what you meant.
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: Mon Jan 19, 2009 11:08 am    Post subject:
Reply with quote

Hello,

Quote:
So you are saying we have to use two sort cards. One using descending sort along with SUM FIELDS = NONE to remove duplicate and then use another sort card resort the above the set of records.
Yes, i believe this would do what you want.

I do not have most of the current Syncsort info with me this weekend - there may be a more elegant way using Syncsort 1.3. I'd prefer one pass of the thata rather than 2 icon_wink.gif

Good luck and i'll continuing to look for a single-pass alternative icon_smile.gif

d
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 11:22 am    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

Okay fine. Let me know if you find any possible way to solve the issue.
In meantime i will try from my side too.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jan 19, 2009 11:37 am    Post subject:
Reply with quote

sumueng,

Do you have more than 2 duplicates in your input? Which record you want in the output in this case?
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 11:54 am    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

These are my duplicate records (key fields is 1 to 13 bytes) from the input file having record length 3635.

ILHBN04861Z00 060308
ILHBN04861Z00 123108

From the above set of records i need to retain the highlighted record and eliminate the other record.

I tried few option like using Descending sort but didn't work out.
Let me know if it is possible
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jan 19, 2009 11:57 am    Post subject:
Reply with quote

Quote:
Let me know if it is possible
sumueng,

We can provide some useful suggestions only if you help us by answering the questions asked here.
Quote:
Do you have more than 2 duplicates in your input? Which record you want in the output in this case?
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 12:06 pm    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

Let me confirm i have got only two duplicate records in which i need to retain the second record and eliminate the first record as specifed in my previous post.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jan 19, 2009 12:52 pm    Post subject:
Reply with quote

sumueng,

You can use the below SYNCTOOL job to achieve this.
Code:
//STEP1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN      DD DSN= Input  file
//OUT     DD DSN= Output file
//TOOLIN  DD *
  SELECT FROM(IN) TO(OUT) ON(1,13,CH) LAST
/*
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 1:27 pm    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

thanks for the tip. i executed using synctool. let me crosscheck if records have come out as expected. I will then update
Back to top
View user's profile Send private message
sumueng

New User


Joined: 27 Nov 2008
Posts: 37
Location: Cochin

PostPosted: Mon Jan 19, 2009 3:54 pm    Post subject: Reply to: Elimate the duplicate record using SYNCSORT
Reply with quote

Thanks for all your suggestion and tips. The duplicate record issue is resolved
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Mon Jan 19, 2009 3:58 pm    Post subject:
Reply with quote

sumueng,

You're welcome. icon_smile.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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