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
 
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 WRITE to VSAM giving duplicate RC picus_mf CICS 1 Fri Feb 23, 2018 2:52 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 10 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm
No new posts Merging records, but not all the time prino DFSORT/ICETOOL 17 Sat Feb 17, 2018 4:20 pm
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm

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