sort column summation



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

sort column summation

Postby satya123 » Fri Dec 23, 2011 5:39 pm

Hi ,
I have the records in following order

RAVI 01 02 03
RAVI 03 06 07
RAVI 04 09 03
SATY 03 04 05

i want the sum column wise ...
My output after sort should be

RAVI 08 17 18
SATY 03 04 05

Can you please help me in this .....
satya123
 
Posts: 1
Joined: Fri Dec 23, 2011 5:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort column summation

 

Re: sort column summation

Postby NicC » Fri Dec 23, 2011 8:34 pm

Yes, we can help but why not help yourself by reading the manual - go to the index and look for SUM and go from there.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: sort column summation

Postby skolusu » Fri Dec 23, 2011 9:24 pm

satya123,

use the following DFSORT jcl which will give you the desired results
//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                     
----+----1----+----2----+----3----+--
RAVI 01 02 03                       
RAVI 03 06 07                       
RAVI 04 09 03                       
SATY 03 04 05                       
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                     
  SORT FIELDS=(1,4,CH,A)             
  SUM FIELDS=(6,2,ZD,9,2,ZD,12,2,ZD)
//*


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/support/docview.wss? ... g3T7000080
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post