View previous topic :: View next topic
|
Author |
Message |
mvmadhavi
New User
Joined: 09 Nov 2006 Posts: 22
|
|
|
|
Code: |
I have a requirement as below
Plan Contract name1 name2 amt1
111 456 abc xyz 456.00
222 456 def pqr 678.00
333 789 ijk rte 4567.65
output should be like:
Plan Contract name1 name2 amt1
111 456 abc xyz 456.00
222 456 def pqr 678.00
1,134.00
333 789 ijk rte 4567.65
Based on same contract the amounts should be summed up and printed in the next line under amt1 field only. giving
I have seen a few posts with sum fields =(1,12,zd), this does not serve the purpose of printing the sum in next line. |
|
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1381 Location: Bamberg, Germany
|
|
|
|
Your line 333 has no sum field, but it should have.
Code: |
OUTFIL FNAMES=(SORTOUT),
REMOVECC,
SECTIONS=(8,3,SKIP=2L,
TRAILER3=(19X,TOT=(35,10,UFF,M18))) |
Code: |
****** ***************************** Top of Data *****
000001 111 456 abc xyz 456.00
000002 222 456 def pqr 678.00
000003 1,134.00
000004
000005 333 789 ijk rte 4567.65
000006 4,567.65
****** **************************** Bottom of Data *** |
|
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2194 Location: USA
|
|
|
|
This is one of the very first samples from ANY manual on SORT utility.
The post must go to the beginners, or students forum. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1381 Location: Bamberg, Germany
|
|
|
|
It certainly is a candidate.  |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3084 Location: NYC,USA
|
|
|
|
Moved thanks |
|
Back to top |
|
 |
|