View previous topic :: View next topic
|
Author |
Message |
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi,
I need to remove the duplicate and sum the fields based on the key fields.
For eg:
Input File:
Code: |
00023 0994
00024-0023
00023-1000
00024 0025
|
Expected Output File:
Code: |
00023-0006
00024 0002
|
I have tried below sort card. its not working..
Code: |
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=(7,4,ZD)
OUTREC OVERLAY=(6:7,4,ZD,EDIT=(STTTT),SIGNS=(,-))
|
Output is:
Code: |
00023 1994
00024 0048
|
For my Sort card just adding the rows based on the key.
Please advise!!! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You field is not ZD, it has a physical "-". Try with FS instead of ZD. |
|
Back to top |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi Bill,
You field is not ZD, it has a physical "-".
Data values having negative values.
That's why i am stuck up. Please provide the sort card.. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you read the first sentence, did you read, and act on, the second? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
use the following DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00023 0994
00024-0023
00023-1000
00024 0025
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,5,TRAILER3=(1,5,TOT=(6,5,SFF,EDIT=(STTTT),SIGNS=(,-))))
//* |
|
|
Back to top |
|
|
|