I have used the ICETOOL to match merge two files and get matching and non matching records using the sample from the book, but I am not sure if I can get the counts in each file and get the SUM in the same step. I was planning to create a separate steps to get record COUNTs and SUM.
Since my input datasets are huge, I would like to get the COUNT and SUM in the same step rather then adding additional SORT steps. Can some one tell me how OCCURS or COUNT can be used in SPLICE datasets and if I can save the information in a dataset?
//S5 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input File1 (FB/10)
//IN2 DD DSN=... input File2 (FB/10)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//** USE MOD FOR T1
// DISP=(MOD,PASS)
//OUT12 DD SYSOUT=* names in File1 and File2
//OUT1 DD SYSOUT=* names in File1 only
//OUT2 DD SYSOUT=* names in File2 only
//TOOLIN DD *
* Add 'BB' identifier for File1 records.
COPY FROM(IN1) TO(T1) USING(CTL1)
* Add 'VV' identifier for File2 records.
COPY FROM(IN2) TO(T1) USING(CTL2)
* SPLICE to match up records and write them to their
* appropriate output files.
SPLICE FROM(T1) TO(OUT12) ON(1,10,CH) WITH(11,1) -
USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
* Add 'BB' (base) identifier to File1 records.
INREC OVERLAY=(11:C'BB')
/*
//CTL2CNTL DD *
* Add 'VV' (overlay) identifier to File2 records.
INREC OVERLAY=(11:C'VV')
/*
//CTL3CNTL DD *
* Write matching records to OUT12 file. Remove id.
OUTFIL FNAMES=OUT12,INCLUDE=(11,2,CH,EQ,C'VB'),BUILD=(1,10)
* Write File1 only records to OUT1 file. Remove id.
OUTFIL FNAMES=OUT1,INCLUDE=(11,2,CH,EQ,C'BB'),BUILD=(1,10)
* Write File2 only records to OUT2 file. Remove id.
OUTFIL FNAMES=OUT2,INCLUDE=(11,2,CH,EQ,C'VV'),BUILD=(1,10)
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input File1 (FB/10)
//IN2 DD DSN=... input File2 (FB/10)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//** USE MOD FOR T1
// DISP=(MOD,PASS)
//OUT12 DD SYSOUT=* names in File1 and File2
//OUT1 DD SYSOUT=* names in File1 only
//OUT2 DD SYSOUT=* names in File2 only
//TOOLIN DD *
* Add 'BB' identifier for File1 records.
COPY FROM(IN1) TO(T1) USING(CTL1)
* Add 'VV' identifier for File2 records.
COPY FROM(IN2) TO(T1) USING(CTL2)
* SPLICE to match up records and write them to their
* appropriate output files.
SPLICE FROM(T1) TO(OUT12) ON(1,10,CH) WITH(11,1) -
USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
* Add 'BB' (base) identifier to File1 records.
INREC OVERLAY=(11:C'BB')
/*
//CTL2CNTL DD *
* Add 'VV' (overlay) identifier to File2 records.
INREC OVERLAY=(11:C'VV')
/*
//CTL3CNTL DD *
* Write matching records to OUT12 file. Remove id.
OUTFIL FNAMES=OUT12,INCLUDE=(11,2,CH,EQ,C'VB'),BUILD=(1,10)
* Write File1 only records to OUT1 file. Remove id.
OUTFIL FNAMES=OUT1,INCLUDE=(11,2,CH,EQ,C'BB'),BUILD=(1,10)
* Write File2 only records to OUT2 file. Remove id.
OUTFIL FNAMES=OUT2,INCLUDE=(11,2,CH,EQ,C'VV'),BUILD=(1,10)
/*