Page 1 of 1

ICETOOL/ICEMAN to SUM values along the same ROW

PostPosted: Thu May 08, 2008 1:07 am
by denis.dhimitri
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

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

PostPosted: Thu May 08, 2008 1:35 am
by Frank Yaeger
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

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

PostPosted: Thu May 08, 2008 2:14 pm
by denis.dhimitri
Thank you very much Mr.Yaeger for your precious help. I really appreciate it.

Best regards
Denis Dhimitri