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 what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm


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