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

Sycsort assign version number for duplicate records


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

New User


Joined: 05 May 2005
Posts: 31

PostPosted: Fri Jan 01, 2010 2:33 am
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: 496
Location: USA

PostPosted: Sat Jan 09, 2010 1:56 am
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: 31

PostPosted: Sat Jan 09, 2010 2:01 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Duplicate transid's declared using CEDA CICS 3
Search our Forums:

Back to Top