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

SYNCSORT - Last duplicate or no duplicate


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sailaja Sankisa

New User


Joined: 12 Mar 2010
Posts: 4
Location: hyderabad

PostPosted: Mon Mar 22, 2010 6:57 pm
Reply with quote

Hi,

I have a FB file (with duplicates) with key in 51:25 and sorted on this key. I need to pick the last occurrence of the duplicates or pick the record in case of no duplicates.

Please let me know how i can achive this using syncsort.

Thanks,
Sailaja.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 22, 2010 7:39 pm
Reply with quote

Sailaja Sankisa

1) DO NOT tag your topic on to the end of another topic.

2) You use SYNCSORT not DFSORT, so please learn to post in the correct forum - JCL for SYNCSORT.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 23, 2010 3:24 am
Reply with quote

Hi,

this should give you the desired results

Code:
//STEP0100 EXEC PGM=SYNCTOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SELECT FROM(IN) TO(OUT) ON(51,25,CH) LAST USING(CTL1)   
/*                                                       
//CTL1CNTL DD *                                           
  OPTION EQUALS                                           
/*                                                       



Gerry
Back to top
View user's profile Send private message
Sailaja Sankisa

New User


Joined: 12 Mar 2010
Posts: 4
Location: hyderabad

PostPosted: Tue Mar 23, 2010 10:02 am
Reply with quote

Hi,

I am sorry to have added my query to another topic. i will sure that i dont repeat this.

Thank you for the solution.

Sailaja.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Mar 23, 2010 11:20 am
Reply with quote

You might be intrested in this too.

http://www.ibmmainframes.com/viewtopic.php?t=41708&highlight=

You cannot code the length greater than 255 in SECTIONS.

Say your file is having LRECL of 300, then you have to do it like this.

Code:
SECTIONS=(51,25,TRAILER3=(1,200,201,100))
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 23, 2010 12:57 pm
Reply with quote

Hello,

The SELECT operator uses OPTION EQUALS to do the sorting, hence you might not need the CTL1 card in Gerry's ciode.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
Search our Forums:

Back to Top