Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Expat,
SUM FIELDS=(...) would not be the best choice here since the values have a decimal point.
Narasimha,
You can use a DFSORT job like the one below to do what you asked for. Since you showed your input records already in sorted order, I used a MERGE which is more efficient than a SORT.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN01 DD *
99999XXXX0000 100.50 c
99999XXXX0000 100.50 c
99999XXXX0001 200.20 c
99999XXXX0001 212.20 c
99999XXXX0002 300.10 c
99999XXXX0002 350.00 c
99999XXXX0003 100.10 c
99999XXXX0003 350.00 c
99999XXXX0003 000.50 c
99999XXXX0004 010.00 c
99999XXXX0004 337.50 c
99999XXXX0004 600.30 c
/*
//SORTOUT DD DSN=... output file
//SYSIN DD *
MERGE FIELDS=(1,13,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,13,
TRAILER3=(1,13,
TOT=(14,10,UFF,EDIT=(IIIIIIT.TT)),
33:33,1))
/*
|
|
|