ICETOOL/ICEMAN to SUM values along the same ROW



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

ICETOOL/ICEMAN to SUM values along the same ROW

Postby denis.dhimitri » Thu May 08, 2008 1:07 am

Hello,

I've an inpup File with 3 fields like this:

DENIS0000500010
DENIS0000500010
MARCO0000500012
MARCO000500012

where the KEY is (1,5,CH) and fields to SUM are (6,5,ZD) with (11,5,ZD)

The OUTPUT shoul be:
DENIS00015
MARCO00017

Every idea will be helpfull guys. Thanks in advance

Denis
denis.dhimitri
 
Posts: 11
Joined: Sat Feb 09, 2008 9:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ICETOOL/ICEMAN to SUM values along the same ROW

Postby Frank Yaeger » Thu May 08, 2008 1:35 am

It appears you want only one record with each key and for that record you want the sum of the two fields. If so, you can use a DFSORT job like the following:

//S1    EXEC  PGM=ICEMAN                                     
//SYSOUT    DD  SYSOUT=*                                     
//SORTIN DD *                                               
DENIS0000500010                                             
DENIS0000500010                                             
MARCO0000500012                                             
MARCO0000500012                                             
//SORTOUT DD SYSOUT=*                                       
//SYSIN    DD    *                                           
  OPTION ZDPRINT                                             
  SORT FIELDS=(1,5,CH,A)                                     
  SUM FIELDS=NONE                                           
  OUTREC BUILD=(1,5,6:6,5,ZD,ADD,11,5,ZD,TO=ZD,LENGTH=5)     
/*


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:

www.ibm.com/servers/storage/support/sof ... 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: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: ICETOOL/ICEMAN to SUM values along the same ROW

Postby denis.dhimitri » Thu May 08, 2008 2:14 pm

Thank you very much Mr.Yaeger for your precious help. I really appreciate it.

Best regards
Denis Dhimitri
denis.dhimitri
 
Posts: 11
Joined: Sat Feb 09, 2008 9:11 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post