Usage of SUM FIELDS



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Usage of SUM FIELDS

Postby janani » Tue Oct 09, 2007 7:52 pm

I uesd sum fields in my JCL. The JCL is executing properly,but where can i see the result of summation?

My input file is

one 12
two 13

The control statement i used for summation is:
SUM FIELDS=(5,2,zd)
janani
 
Posts: 4
Joined: Sat Oct 06, 2007 3:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Usage of SUM FIELDS

 

Re: Usage of SUM FIELDS

Postby Frank Yaeger » Tue Oct 09, 2007 9:12 pm

SUM gives you a total for amounts in records with the same key. The SORT statement gives the key. You haven't shown your SORT statement, but let's assume it's SORT FIELDS=(1,3,CH,A). In that case, since the key in record 1 is 'one' and the key in record 2 is 'two', the keys do not match and the amounts are not summed. So your output records will look identical to your input records. If the keys in the two records matched (e.g. 'one' in both), then the amounts would be summed and you would only have one record for output. For example:

input

one 12
one 13

output

one 25

Now the question is - what are you actually trying to do? Are you trying to sum when records have the same key, or are you trying to get a total for all of the records, or what?

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Usage of SUM FIELDS

Postby janani » Thu Oct 11, 2007 10:44 pm

Thanks frank. I have gone thru DFSORT: Beyond sorting and Getting started with DFSORT. I learnt many things
janani
 
Posts: 4
Joined: Sat Oct 06, 2007 3:48 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post