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
 
SYNCSORT - Last duplicate or no duplicate

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - Last duplicate or no duplicate
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: 8620
Location: Back in jolly old England

PostPosted: Mon Mar 22, 2010 7:39 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Mar 23, 2010 3:24 am    Post subject:
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    Post subject:
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    Post subject: Reply to: SYNCSORT - Last duplicate or no duplicate
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: 2287
Location: @my desk

PostPosted: Tue Mar 23, 2010 12:57 pm    Post subject:
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    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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am

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