View previous topic :: View next topic
|
Author |
Message |
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
Is there a possibility to sum several amounts in one line and add the total ammount to that line by using syncsort.
Example: build total of columns 1,3,5 and 2,4,6
Would be: 99 and 132
Add this to the line
InputFile: 11 22 33 44 55 66 77 88
OutputFile: 11 22 33 44 55 66 77 88 - 99 132
I also post this question in DFSORT-Section, cause i work on several plattforms using Syncsort and Ddfsort. So it's beneficial to have both solutions.
Thank's in advance ! |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
check this
Code: |
//*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
11 22 33 44 55 66 77 88
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(30:(1,2,ZD,ADD,7,2,ZD,ADD,13,2,ZD),EDIT=(TTT),
40:(4,2,ZD,ADD,10,2,ZD,ADD,16,2,ZD),EDIT=(TTT))
/* |
|
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
The following program will suits ur need.
Code: |
//JSTP0010 EXEC PGM=SYNCSORT
//SORTIN DD DSN=DEV2.RK.TEST(@@CASE1),
// DISP=SHR
//SORTOUT DD DSN=DEV2.RK.TEST(@@CASE2),
// DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(25:1,2,ZD,ADD,7,2,ZD,ADD,13,2,ZD,LENGTH=4,
30:4,2,ZD,ADD,10,2,ZD,ADD,16,2,ZD,LENGTH=4)
/*
//*
|
Input:
Code: |
11 22 33 44 55 66 77 88
|
Output:
Code: |
11 22 33 44 55 66 77 88 99 132
|
Regards
R KARTHIK |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Thank's, that's really what i need ! |
|
Back to top |
|
|
|
|