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
 

 

Sycsort assign version number for duplicate records

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

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Fri Jan 01, 2010 2:33 am    Post subject: Sycsort assign version number for duplicate records
Reply with quote

I have an input file that looks like

AAA
BBB
AAA
CCC
AAA
DDD
BBB

I want the output to look as

AAA-01
BBB-01
AAA-02
CCC-01
AAA-03
DDD-01
BBB-02
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Jan 09, 2010 1:56 am    Post subject:
Reply with quote

Here is a SyncSort for z/OS job that will do what you asked:
Code:
//S1   EXEC PGM=SORT   
//SYSOUT DD SYSOUT=*
//SORTIN DD *                                               
AAA                                                         
BBB                                                         
AAA                                                         
CCC                                                         
AAA                                                         
DDD                                                         
BBB                                                         
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)                                   
//SYSIN  DD * 
   INREC FIELDS=(1,3,C'-',7:SEQNUM,8,ZD)                     
   SORT FIELDS=(1,3,CH,A)                                   
   OUTREC FIELDS=(1,4,SEQNUM,2,ZD,RESTART=(1,3),7,8)
/*
//S2    EXEC PGM=SORT         
//SYSOUT  DD SYSOUT=*   
//SORTIN  DD DISP=SHR,DSN=&&TEMP 
//SORTOUT DD DSN=Output.File
//SYSIN   DD *                   
   SORT FIELDS=(7,8,CH,A)       
   OUTREC FIELDS=(1,6)
/*       
Back to top
View user's profile Send private message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Sat Jan 09, 2010 2:01 am    Post subject: Reply to: Sycsort assign version number for duplicate record
Reply with quote

Thanks Allissa, it worked.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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