help in icetool to sum the fields and eliminating duplicates



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

help in icetool to sum the fields and eliminating duplicates

Postby gsatheeesh » Tue Jul 29, 2008 7:42 pm

I need help to get the duplicate records eliminated for the file having 80 length of fixed block

my input looks like this:
AAA 20080122 1200
AAA 20091201 1800
AAA 20070506 3000

i need a output file with sum of values in third field for duplicates and with maximum date in the second column:
AAA 20091201 6000


Satheesh
gsatheeesh
 
Posts: 4
Joined: Tue May 27, 2008 7:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: help in icetool to sum the fields and eliminating duplicates

 

Re: help in icetool to sum the fields and eliminating duplicates

Postby Frank Yaeger » Tue Jul 29, 2008 9:32 pm

Here's a DSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
AAA 20080122 1200
AAA 20091201 1800
AAA 20070506 3000
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,3,
      TRAILER3=(1,4,MAX=(5,8,ZD,TO=ZD,LENGTH=8),X,
        TOT=(14,4,ZD,TO=ZD,LENGTH=4)))
/*
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: help in icetool to sum the fields and eliminating duplicates

Postby gsatheeesh » Wed Jul 30, 2008 9:51 am

thanks a lot frank for your valuable reply
gsatheeesh
 
Posts: 4
Joined: Tue May 27, 2008 7:04 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post