View previous topic :: View next topic
|
Author |
Message |
venkata.ravi
New User
Joined: 09 May 2005 Posts: 30 Location: Hyderabad
|
|
|
|
Hi Bill,
It's not the new issue at all.
COL11 should be summed up if COL1 to COL10 are equal, Before computing the totals, we need to pair up all the different COL12 values. With the above sort card, Totals can be computed if COL1 to COL10 and COL12 values are equal.
Code: |
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,121,128,50,
TRAILER3=(1,121,TOT=(122,6,ZD),128,50)) |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
COL1-10 somevalue
COL11 amount1
COL12 A
COL1-10 samevalueasabove
COL11 amount2
COL12 B
COL1-10 samevalueasabove
COL11 amount3
COL12 A
|
With your code the above will get three output records with no "summing", ie your output will be equal to your input..
What you said you wanted, it seems to me, is one "summed" record of COL1-20 with A,B in COL12.
So, what do you want in the above case? |
|
Back to top |
|
|
venkata.ravi
New User
Joined: 09 May 2005 Posts: 30 Location: Hyderabad
|
|
|
|
Hi Bill,
with my sort card, and with your criteria, it will result in only 2 records. which is expected.
Code: |
Input taken
--+----2----+----3---
*********************
20130306000150ABCDE
20130306000250B
20130306000350ABCDE
*********************
Output:
--+----2----+----3----+----4--
******************************
20130306 500 ABCDE
20130306 250 B
****************************** |
COL11 converts to ZD. 150+350 summed up and becomes 500 for COL12 ABCDE, as they are same. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Presumably you are sorting on COL12 then, which you didn't mention.
Presumably also you no longer need the "consolidation" of COL12?
That's good.
So you just need to extend the COL11 for the TOT so it doesn't overflow so easily. I'd append C'0',startCOL11,lengthCOL11 to the end of the record and TOT on that. |
|
Back to top |
|
|
venkata.ravi
New User
Joined: 09 May 2005 Posts: 30 Location: Hyderabad
|
|
|
|
Hi Bill,
I'm still working on consolidation of COL12 values, which is the last step in the requirement.
On the other hand, I have just sent the sample reports to users and requested their feedback on the output file (this does not cover consolidation of COL12). I'm waiting for their response on this. |
|
Back to top |
|
|
|