Page 1 of 1

help in icetool to sum the fields and eliminating duplicates

PostPosted: Tue Jul 29, 2008 7:42 pm
by gsatheeesh
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

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

PostPosted: Tue Jul 29, 2008 9:32 pm
by Frank Yaeger
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)))
/*

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

PostPosted: Wed Jul 30, 2008 9:51 am
by gsatheeesh
thanks a lot frank for your valuable reply