View previous topic :: View next topic
|
Author |
Message |
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Hi,
I am using below SYNCSORT job but unsuccessful to achieve the expected output..........
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 |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
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 |
|
|
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Hi Alissa Margulies,
I have changed the code like below and got the output as expected..
Code: |
//SYSIN DD *
SORT FIELDS=(1,6,CH,A)
OUTREC OVERLAY(20:SEQNUM,3,ZD,RESTART=(1,6))
/*
|
Thank you very much. |
|
Back to top |
|
|
|