IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merging records and calculating TOTALS - SyncSort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkata.ravi

New User


Joined: 09 May 2005
Posts: 30
Location: Hyderabad

PostPosted: Wed Apr 03, 2013 2:48 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 3:28 pm
Reply with quote

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
View user's profile Send private message
venkata.ravi

New User


Joined: 09 May 2005
Posts: 30
Location: Hyderabad

PostPosted: Wed Apr 03, 2013 3:56 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 03, 2013 4:08 pm
Reply with quote

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
View user's profile Send private message
venkata.ravi

New User


Joined: 09 May 2005
Posts: 30
Location: Hyderabad

PostPosted: Wed Apr 03, 2013 4:48 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top