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

How to eliminate first duplicate record in PS file?


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

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Tue Mar 17, 2009 5:25 pm
Reply with quote

Hi,

My input PS file is FB and record length of 135 bytes. The key value in the file is located from column 32 to 45 (i.e. 14 bytes).
At any time I have only two duplicate records in the input file based on the key value.

//SYSIN DD *
SORT FIELDS=(32,14,CH,A)
SUM FIELDS=NONE,XSUM
/*
//

If I use the above control card, it eliminates the second duplicate record and writes the first duplicate record in the output file.

But I want second duplicate record instead of first duplicate record in the output file. Please help me on the same...
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 17, 2009 5:44 pm
Reply with quote

jaganmoni1,

You can use the below SYNCTOOL job to achieve what you want.
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(32,14,CH) LAST
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Tue Mar 17, 2009 6:03 pm
Reply with quote

its working fine... Thanks a lot for your quick reply
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top