Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
anshul_gugnani,
The below Syncsort job will do what you asked for. I have assumed the field positions as in your sample input.
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN= Input file-1 --> FB/50
// DD DISP=SHR,DSN= Input file-2 --> FB/50
//SORTOUT DD DSN= Output file --> FB/50
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(51:SEQNUM,8,ZD,10C'0')),
IFTHEN=(WHEN=(1,5,CH,EQ,C'TOTAL'),OVERLAY=(51:8C'9',41,10))
SORT FIELDS=(51,8,CH,A,21,8,CH,A),EQUALS
SUM FIELDS=(59,10,ZD)
OUTREC IFTHEN=(WHEN=(1,5,CH,EQ,C'TOTAL'),BUILD=(1,40,59,10)),
IFOUTLEN=50 |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hi Arun,
Thanks for the sort card. This works perfect. Sorry could not reply earlier as was away from mainframes.
Could you please explain the EQUALS in this sortcard. I read EQUALS in manual but was not very clear.
Thanks,
Anshul. |
|