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

Syncsort - How to renumber?


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

New User


Joined: 23 Sep 2008
Posts: 10
Location: Chennai

PostPosted: Mon Oct 13, 2008 7:47 pm
Reply with quote

Hi,

I am using below SYNCSORT job but unsuccessful to achieve the expected output.......... icon_sad.gif

Code:

//STEP01   EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTOUT  DD SYSOUT=*                           
//SORTIN   DD *                                 
800800 FAVER                                     
610700 CRUSO                                     
790650 BRODY                                     
610700 CRUSA                                     
650001 KENTS                                     
790650 BROLS                                     
610700 CRUSB                                     
/*                                               
//SYSIN    DD *                                 
 SORT FIELDS=(1,6,ZD,A)                         
 INREC OVERLAY(20:SEQNUM,3,ZD,RESTART=(1,4))
/*                                               


Input file:
Code:

800800 FAVER
610700 CRUSO
790650 BRODY
610700 CRUSA
650001 KENTS
790650 BROLS
610700 CRUSB


Unexpected Output:
Code:

610700 CRUSO       001
610700 CRUSA       001
610700 CRUSB       001
650001 KENTS       001
790650 BRODY       001
790650 BROLS       001
800800 FAVER       001


Expected Output:
Code:

610700 CRUSO       001
610700 CRUSA       002
610700 CRUSB       003
650001 KENTS       001
790650 BRODY       001
790650 BROLS       002
800800 FAVER       001


Thanks.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Oct 13, 2008 7:55 pm
Reply with quote

INREC processing occurs before SORT processing. You need to sort the data before assigning the sequence number. Change your INREC statement to an OUTREC statement and give that a try.
Back to top
View user's profile Send private message
gorman
Currently Banned

New User


Joined: 23 Sep 2008
Posts: 10
Location: Chennai

PostPosted: Mon Oct 13, 2008 8:07 pm
Reply with quote

Hi Alissa Margulies,

I have changed the code like below and got the output as expected.. icon_biggrin.gif

Code:

//SYSIN    DD *                             
 SORT FIELDS=(1,6,CH,A)                     
 OUTREC OVERLAY(20:SEQNUM,3,ZD,RESTART=(1,6))
/*                                           


Thank you very much. 36_8_11.gif
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 Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top