Gopikrishnan K
New User
Joined: 13 Oct 2006 Posts: 3
|
|
|
|
Hi,
I have 3 files in the below format -
File1
AAA BBB CCC
31.00 34.00 24.00
File2
AAA BBB CCC
30.00 34.00 24.00
File3
AAA BBB CCC
30.00 34.00 24.00
I need an output with the sum under each header as follows -
Output file -
AAA BBB CCC
91.00 102.00 72.00
Can anyone suggest a solution for this?
Thanks in advance,
Gopikrishnan K |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. Be sure to use MOD for the //OUT DD.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file1
// DD DSN=... input file2
// DD DSN=... input file3
//OUT DD DISP=MOD,DSN=... output file
//TOOLIN DD *
COPY FROM(CON) TO(OUT) USING(CTL1)
COPY FROM(CON) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
* Get header
OPTION STOPAFT=1
/*
//CTL2CNTL DD *
* Get total for detail records
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
OMIT=(1,1,CH,EQ,C'A'),
TRAILER1=(1:TOT=(1,6,UFF,EDIT=(IIT.TT)),
13:TOT=(13,6,UFF,EDIT=(IIT.TT)),
24:TOT=(24,6,UFF,EDIT=(IIT.TT)))
/*
|
|
|