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
 
Syncsort - How to renumber?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - How to renumber?
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: 500
Location: USA

PostPosted: Mon Oct 13, 2008 7:55 pm    Post subject:
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    Post subject: Reply to: Syncsort - How to renumber?
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    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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am

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